Limit the length of input field using angular2

后端 未结 3 726
[愿得一人]
[愿得一人] 2021-01-14 03:57

I have implemented the directive to restrict the input field using angular2. It is working fine in desktop browser, but not working in android mobile.

component

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-14 04:47

    you should use max-length html5 attribute and then use form validation for Angular2, no custom directive needed.

提交回复
热议问题