Wishlist: set properties of Custom Elements in templates #16235
Description
I'm submitting a ...
- bug report
- [x ] feature request
- other (Please do not submit support requests here (see above))
Current behavior:
Currently, you can't property bind HTMLElement properties in templates
Expected / new behavior:
If you have a custom element my-elem, you could property bind it to an expression:
<my-elem ng-prop-myprop="$ctrl.getComplexValue()"></my-elem>
ng.attr doesn't work for this because the value needs to be a string. Properties can be arbitrary complex JS object.
Minimal reproduction of the problem with instructions:
Currently you need to imperatively dig up the HTMLElement and assign the property in js code:
https://gist.github.com/vivainio/7025b4f5c1d90ab168981419f735d73a
AngularJS version: 1.6
Browser: [all | Chrome XX | Firefox XX | Edge XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
All.
Anything else:
Relevant blog post that illustrates the "clumsier" (imperative) way of doing this: https://medium.com/@vivainio/using-stenciljs-components-in-angular-1-application-2f09287c151