填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

MaxValidator

A directive which installs the MaxValidatorfor any formControlName, formControl, or control with ngModel that also has a max attribute.

参见

Exported from

选择器

属性

属性说明
@Input()
max: string | number

Tracks changes to the max bound to this directive.

说明

Adding a max validator

The following example shows how to add a max validator to an input attached to an ngModel binding.

      
      <input type="number" ngModel max="4">