-
Notifications
You must be signed in to change notification settings - Fork 27.5k
docs(ngModel.NgModelController): Example inputs behave the same when … #13340
Conversation
…they shouldn't. The first input demonstrating $rollbackViewValue is meant to rollback the value, not make it blank. Code in it's current state makes both behave the same.
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
Hmm. If you remove |
The core feature we're aiming at here is when hitting escape after changing Perhaps a blank initial value is a bad use case. What the demo aims to If it does, I'll update my pull request accordingly. On Nov 19, 2015 7:55 AM, "Martin Staffa" [email protected] wrote:
|
On further investigation: the use case for rollbackViewValue is actually quite obsolete. If by pressing ESC you set assign a value to the model like "whatever", and then blur the input, it will not set it to the last thing you've entered. Somewhere along the line, it must have been built in that this handled correctly. I will change this example to simply show that $rollbackViewValue resets the view to the last commited value. Thanks for bringing attention to this. |
On even further investigation, the described problem does happen, but only when you are trying to set the model to a value that it is already set to, like ''. The thing is that the description of the example is not set up to elicit this behavior. |
…mple The example has been expanded to make it easier to provoke the behavior that the description is talking about (rollbackViewValue and programmatic model updates) Related #13340
…mple The example has been expanded to make it easier to provoke the behavior that the description is talking about (rollbackViewValue and programmatic model updates) Related #13340
…they shouldn't.
The first input demonstrating $rollbackViewValue is meant to rollback the value, not make it blank. Code in it's current state makes both behave the same.