Have $formatters be called when view is first populated?

后端 未结 1 513
别跟我提以往
别跟我提以往 2021-01-20 06:44

NgModelController provides $formatters for model -> view transformations. I am playing with it in this fiddle. It works fine after I make changes t

1条回答
  •  一整个雨季
    2021-01-20 07:15

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

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

    See also this google group post.

    0 讨论(0)
提交回复
热议问题