You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

19 lines
491 B

<form #form="ngForm">
<div>
單價:<input
type="text"
name="price"
#price="ngModel"
ngModel
appDecimalValidator
[digitLength]="2"
[scaleLength]="1"
/>
<ng-container *ngIf="price.touched">
<span *ngIf="price.hasError('decimal')">
單價應為 {{ price.errors?.decimal.digitLength }} 位整數位與
{{ price.errors?.decimal.scaleLength }} 位整數位的數值
</span>
</ng-container>
</div>
</form>