Min and max value of input in angular4 application

后端 未结 9 1106
温柔的废话
温柔的废话 2020-12-08 13:01

I have an angular4 application with a form. In this one I have an input to enter a percentage. So, I want to block the input with value between 0 and 100. I tried to add

9条回答
  •  Happy的楠姐
    2020-12-08 13:47

    Most simple approach in Template driven forms for min/max validation with out using reactive forms and building any directive, would be to use pattern attribute of html. This has already been explained and answered here please look https://stackoverflow.com/a/63312336/14069524

提交回复
热议问题