Should $ formatters be called when the view is first populated?

NgModelController provides $formatters for model conversion β†’. I play with this in fiddle . It works fine after making changes to the model using another input, but my formatter is not called when the value is initially populated. Is there any way to do this?

+3
angularjs
source share
1 answer

Whenever the variable $ modelValue changes, all $ formatters are called. So after calling the read () function, set $ modelValue to run $ formatters to run:

 read(); // initialize ngModel.$modelValue = ''; // causes $formatters to run 

See also this google group post .

+4
source share

All Articles