This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngModel is locked into the isolate scope when used on a component #1924
Closed
Description
When ngModel directive is used on an element that represents a component (implemented via a directive with isolate scope), ngModel is locked into this isolate scope and in order to get out and make ngModel useful the ngModel expression has to be prefixed with $parent.
so instead of:
{{my.model}}
<my-component ng-model="my.model"></my-component>
one has to write:
{{my.model}}
<my-component ng-model="$parent.my.model"></my-component>
this is non-intuitive and might be hard to debug for developer unfamiliar with what's going on.
the solution must however take into account that it's possible to use ngModel within the template of the isolated component, in which case we must not leak the model outside of the component.
Metadata
Metadata
Assignees
Labels
No labels