This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.5k
NgModel needs a way to manually re-run the formatter chain #3407
Closed
jpsimons opened this issue
Jul 31, 2013
· 3 comments
· Fixed by angular-indonesia/angular.js#73 or javascript-indonesias/angular.js#15
Closed
NgModel needs a way to manually re-run the formatter chain #3407
jpsimons opened this issue
Jul 31, 2013
· 3 comments
· Fixed by angular-indonesia/angular.js#73 or javascript-indonesias/angular.js#15
Labels
Milestone
Comments
Well, I guess one could just copy that block into a directive. It's all public stuff. Would be handy to have a function to do it for you though. |
realityking
added a commit
to realityking/angular.js
that referenced
this issue
Jan 15, 2015
realityking
added a commit
to realityking/angular.js
that referenced
this issue
Jan 15, 2015
realityking
added a commit
to realityking/angular.js
that referenced
this issue
Jan 17, 2015
realityking
added a commit
to realityking/angular.js
that referenced
this issue
Jan 25, 2015
realityking
added a commit
to realityking/angular.js
that referenced
this issue
Mar 4, 2015
realityking
added a commit
to realityking/angular.js
that referenced
this issue
Mar 5, 2015
+1 would be really nice to have this. the lack of async formatters and parsers makes working with async data pretty nasty. this would help prevent some of the race conditions introduced by synchronous validation against an async data source. for reference, i did it very similarly to @jpsimons: scope.$watch('myAsyncCollection', () => {
ngModel.$viewValue = ngModel.$formatters.reduceRight((prev, fn) => fn(prev)), ngModel.$modelValue)
ngModel.$render()
}) |
just if someone is searching the code snippet - it has moved: |
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Sep 21, 2017
3 tasks
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Sep 25, 2017
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Sep 25, 2017
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Sep 26, 2017
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Sep 26, 2017
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Sep 27, 2017
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Sep 27, 2017
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Sep 27, 2017
Narretz
added a commit
to Narretz/angular.js
that referenced
this issue
Sep 29, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
See this fiddle:
http://jsfiddle.net/tPWBK/1/
Say you have a data transformation directive that requires 'ngModel' and adds to the formatter and parser chains. If the transformation is dependent on some dynamic data other than $modelValue or $viewValue, there's no way to do a watch on that data and re-run the formatter chain.
See this excerpt from https://github.com/angular/angular.js/blob/master/src/ng/directive/input.js#L1081
Should everything inside the (ctrl.$modelValue !== value) check be a function that's exposed publicly on NgModelController?
The text was updated successfully, but these errors were encountered: