填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫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">