I'd like some input on how well I wrote
this directive. Am I making proper Angular design decisions here? Is there a better way to do this? I'm applying the formatting on the 'blur' event - which I'd rather have a better way to do.
I used to call $setViewValue within the parser; however, when I did this the curser would get 'locked'. I notice that in the Angular UI version, it seems the numbers are just being pushed from left to right:
12345 -> 12[add X]345 -> 12X34
Notice how the '5' got pushed off. It seems that the whole value is not being replaced at once - which is what I was doing.
I sniffed around the source code for the Angular UI Mask directive but it was quite overwhelming - there's a lot going on in there...
Any advice?
Thanks guys.