-
Notifications
You must be signed in to change notification settings - Fork 27.4k
external removal of input formatters #10168
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/. If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check the information on your CLA or see this help article on setting the email on your git commits. Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name. |
@rupe120 thnx for the PR. I can see what you are trying to do but the proposed change is not good as it breaks the existing tests (so the existing functionality as well). I think that the problem with the parsers / formatters pipeline is somehow deeper and we should look into it alongside with other issues around NgModelController. @Narretz @petebacondarwin the real use-case from the typeahead is that currently NgModelController is missing a hook point that would allow us to do some processing when a value in the input changes. What is missing is an equivalent of the ngChange - sth like ngViewChange or similar (registering to the input event is not good since there is already too much magic going on around view change detection - the logic that we don't want to duplicate in custom directives). I think that we should keep the typeahead use-case in mind while working on the form changes in 1.4 or whenever it happens. |
@googlebot the CLA is now signed @pkozlowski-opensource You're welcome. I apologize for not running the unit tests. If I can get these changes to work with the tests, should I resubmit, or is this change not something that you are comfortable with? I agree that the real fix should take into account other issues that I'm not aware of, but it seems like this may be an ok bandaid until then. |
@pkozlowski-opensource Pete created the forms doc; I think you should be able to edit it too: https://docs.google.com/document/d/1-MhomULgCFOXVsqAGrI7l-cXYMYmJM4BMzgy_anC93o |
@Narretz awesome. Glad to hear that you were pondering view change listeners. |
@rupe120 Why can't you remove the formatter from a directive? |
@pkozlowski-opensource Ok sounds good. @Narretz It was more a matter of reliably removing the correct formatter if there were other's added |
I'm attempting to come up with a solution for this ui.Bootstrap Typeahead bug: angular-ui/bootstrap#2681
An alternative to this pull request is questioning if we really need the formatter which does the toString()
The removeByFnName() would be called from the Typeahead to remove the stringBasedInputTypeFormatter
Thoughts?