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.
Proposal for one-way binding option #13900
Closed
Description
I'd like to propose a way to allow directives to support one-way binding. Currently this is not an option and the only way to capture data from parent scope is by using two-way '=' binding or '&' binding. '&' binding would work but creates a semantic issue because it is expression based. To solve this a new binding option needs to be added so that we can do something like this:
scope: {
myOneWayProperty: '-'
}
When the one-way binding option is specified this indicates that the scope property should be replaced with the evaluated value from $parent scope.
scope.myOneWayProperty = $parse(scope.myOneWayProperty)(scope.$parent);
With this option we can now pass objects to a directive without the need for two watches and without having function callback semantic
Metadata
Metadata
Assignees
Labels
No labels