Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(ngModel): public method to force run model -> view binding pipeline #12818

Closed
wants to merge 1 commit into from
Closed

feat(ngModel): public method to force run model -> view binding pipeline #12818

wants to merge 1 commit into from

Conversation

aleksanyan
Copy link

Added ngModel.NgModelController#$forceModelToViewBound.
It triggers $formatters pipeline, and in case of changed $viewValue,
runs validators and update the UI without changing actual model.
Basically it simulates fake model value change.

Closes #12815

Added ngModel.NgModelController#$forceModelToViewBound.
It triggers $formatters pipeline, and in case of changed $viewValue,
runs validators and update the UI without changing actual model.
Basically it simulates fake model value change.

Closes #12815
@Narretz
Copy link
Contributor

Narretz commented Sep 11, 2015

Thanks for the PR. It's something that's come up a few times, we'll consider it for 1.5
In the example in your issue, where would you call this function? In a $parser?

@aleksanyan
Copy link
Author

Welcome. I would call it from ngModelController (as in PR). So it could be called publically in the end application.
I realize the PR's code is not clean enough, so if you like the idea, I can clean up and push.

Also would be good to have similar function for $parsers pipeline.
http://stackoverflow.com/questions/27565742/trigger-ngmodelcontroller-parsers-pipeline-from-a-watch/32149600#32149600

@Narretz
Copy link
Contributor

Narretz commented Sep 11, 2015

I meant from where would you call it? As in from which part of your
application? Inside an ngModel parser, inside a directive when something
chnages or an event happens, or from ngChange ...
Am 11.09.2015 13:21 schrieb "Artur Aleksanyan" [email protected]:

Welcome. I would call it from ngModelController (as in PR). So it could be
called publically in the end application.
I realize the PR's code is not clean enough, so if you like the idea, I
can clean up and push.

Also would be good to have similar function for $parsers pipeline.

http://stackoverflow.com/questions/27565742/trigger-ngmodelcontroller-parsers-pipeline-from-a-watch/32149600#32149600


Reply to this email directly or view it on GitHub
#12818 (comment).

@aleksanyan
Copy link
Author

Inside a directive, on click event for some button.

@Narretz
Copy link
Contributor

Narretz commented Oct 7, 2017

Implemented in 05fdf91

@Narretz Narretz closed this Oct 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants