multiple ng-model-options are not merged when inherited #15201
Description
Since #7212, the example in the documentation indicates that multiple ngModelOptions are merged:
<div ng-model-options="{ allowInvalid: true }">
<form ng-model-options="{ updateOn: 'blur' }">
<input ng-model-options="{ updateOn: 'default' }" />
</form>
</div>
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?