You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
According to the doc, this should yield for the input element: { allowInvalid: true, updateOn: 'default' }
But this is not working: options set on children elements will simply override the options from the parent (without merging).
So the input element in the previous exemple has the following options: { updateOn: 'default' }
See plunker (I had to inspect the input's ngModel controller to have a look at its $options to be sure)
The documentation (not the example) does not say anything about merging multiple options:
If a setting is not specified as a property on the object for a particular ngModelOptions directive then it will inherit that setting from the first ngModelOptions directive found by traversing up the DOM tree. If there is no ancestor element containing an ngModelOptions directive then the settings in $modelOptions will be used.
So I think the behavior is the expected one, but the example is wrong so this should be a simple doc fix. Is that correct?
The text was updated successfully, but these errors were encountered:
You are apparently using Angular v1.5.8, but the docs you mention are from the latest code on the master branch. The v1.5.8 docs can be found here and they should be consistent with the behavior in the example.
Note, that there has been a change wrt ngModelOptions. In v1.5.x, an element would inherit its ancestor's ngModelOptionsonly if it didn't have its own ngModeOptions. Since v1.6.x (yet to be released), the inheritance is more granular, so even if an element has its own ngModelOptions, it will still inherit specific properties that it doesn't have.
(The related PR is #10922.)
(Since this is a breaking change, it will not be backported to v1.5.x, so v1.5.x will keep the current "inherit-all-or-nothing" behavior.)
Since #7212, the example in the documentation indicates that multiple ngModelOptions are merged:
According to the doc, this should yield for the input element:
{ allowInvalid: true, updateOn: 'default' }
But this is not working: options set on children elements will simply override the options from the parent (without merging).
So the input element in the previous exemple has the following options:
{ updateOn: 'default' }
See plunker (I had to inspect the input's ngModel controller to have a look at its $options to be sure)
The documentation (not the example) does not say anything about merging multiple options:
So I think the behavior is the expected one, but the example is wrong so this should be a simple doc fix. Is that correct?
The text was updated successfully, but these errors were encountered: