I'm trying to make a number input that is for only positive numbers. I have the following html:
As you can see, I've implemented ng-pattern and min value but neither one works. In the controller:
quantity: number=1;
i=1;
plus(){
this.i++;
this.quantity=this.i;
}
minus(){
this.i--;
this.quantity=this.i;
}
When I add the following to the controller, I get the error " Property 'match' does not exist on type 'number'"
this.quantity.match(/^(0|\+?[1-9]\d*)$/g);

Laxmidhar SahooPosted May 19, 2020, 1:04 AM