ngMask icon indicating copy to clipboard operation
ngMask copied to clipboard

"Error: value.split is not a function" when model is int

Open im1dermike opened this issue 9 years ago • 2 comments

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.

im1dermike avatar Oct 02 '15 19:10 im1dermike

I'm running into this same issue. Thanks for finding it.

gilm0079 avatar Nov 20 '15 15:11 gilm0079

@gilm0079 The work around is to toString() the value, but that's not ideal. Hoping the owner of ngMask will fix this issue soon...

im1dermike avatar Nov 24 '15 20:11 im1dermike