ngMask
ngMask copied to clipboard
"Error: value.split is not a function" when model is int
I'm attempting to use the following mask:
<input ng-model="num" type="text" mask="d?d?d?" mask-restrict="reject"/>
From the documentation, this will mask the input to be up to 3 digits and will reject invalid input. When the model is a string, it works fine, but when the model is an int, it still works, but I get the following erro in my browser's console:
value.split is not a function
Please see my Plunker: http://plnkr.co/edit/2TZHzMYG3s2K6FutwIhW?p=preview.
I'm running into this same issue. Thanks for finding it.
@gilm0079 The work around is to toString()
the value, but that's not ideal. Hoping the owner of ngMask will fix this issue soon...