Javascript html持续时间选择器的格式不正确

Javascript html持续时间选择器的格式不正确,javascript,angular,typescript,Javascript,Angular,Typescript,我正在尝试实现一个外部库,它允许我输入文档的长度 我正在使用html持续时间选择器库,但输入在持续时间内无法正常工作 我是否错过了导入或库有问题 有人能帮我吗 多谢各位 HTML <h2>Result:</h2> Regular Input box <br><code>&#x3C;input type="text"&#x3E;</code> <br> <input type=&q

我正在尝试实现一个外部库,它允许我输入文档的长度

我正在使用html持续时间选择器库,但输入在持续时间内无法正常工作

我是否错过了导入或库有问题

有人能帮我吗

多谢各位

HTML

<h2>Result:</h2>
Regular Input box <br><code>&#x3C;input type="text"&#x3E;</code> <br>
<input type="text">
<br><br>
Duration Input box <br><code>&#x3C;input class="html-duration-picker"&#x3E;</code> <br>
<input type="text" class="html-duration-picker">
<br><br>
Hide Seconds <br><code>&#x3C;input class="html-duration-picker" data-hide-seconds&#x3E;</code> <br>
<input type="text" class="html-duration-picker" data-hide-seconds>
<br>
您忘了初始化它(我在提供的库的文档中读到):

编辑:

以下是更新的stackblitz示例:

import { Component, VERSION } from '@angular/core';
import * as HtmlDurationPicker from 'html-duration-picker';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  name = 'Angular ' + VERSION.major;

  ngAfterViewInit() {
    HtmlDurationPicker.init();
  }
}