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.
Add ng-prop-* to one-way bind an expression to arbitrary element properties #10072
Closed
Description
ng-prop-* could take an expression and bind to arbitrary properties:
ng-prop-checked="some.expression"
This would be similar to the current ng-attr-*:
ng-attr-x="{{interpolation}}"
Reasoning:
- Angular 2.0 is going this sort of direction. So this will help ease migration. Migration pain is one of the main complaints right now for 2.0, it seems to me.
- Get the benefits of the Angular 2.0 approach without waiting 1.5 years.
- ng-prop-* would always takes an expression, so it's clear what format the right hand side should be, regardless what property is being modified
- ng-prop-* would work on all properties (like ng-attr-*), even from custom web components
- etc.?
- (Minor) Provides nice symmetry from jQuery API to Angular API:
$.fn.prop and $ .fn.attr - Binding to arbitrary properties requires custom compiler support to recognize all ng-prop-* attributes without explicitly adding each as separate directives, so this is why I think it belongs in core.