Angular Dart角组件验证程序示例

Angular Dart角组件验证程序示例,angular,dart,components,Angular,Dart,Components,您好,我正在使用省道角组件。我尝试在代码中使用数字验证器: 材料编号指示器, 正枚举验证器, 检查非负蒸发量, 上限验证器 你能举例说明如何在实践中使用它们吗 在第一部分中,增加了: @Component( ... directives: const [ CORE_DIRECTIVES, materialNumberInputDirectives, materialDirectives ], providers: const [NG_VALIDATORS

您好,我正在使用省道角组件。我尝试在代码中使用数字验证器: 材料编号指示器, 正枚举验证器, 检查非负蒸发量, 上限验证器 你能举例说明如何在实践中使用它们吗

在第一部分中,增加了:

@Component(
   ...
  directives: const [
    CORE_DIRECTIVES,
    materialNumberInputDirectives,
    materialDirectives
  ],
  providers: const [NG_VALIDATORS]
)
在模板中我有

  <material-input label="What do you need to do?"
                  autoFocus floatingLabel style="width:80%"
                  [(ngModel)]="newTodo"
                  (keyup.enter)="add()"
                  type="number"
                  checkInteger
                  checkPositive
                  >
  </material-input>

但它不起作用