jquery selectors - querySelect angular component as MyComponent -
i have angular component
class="lang-dart prettyprint-override"><my-component foo="" bar=""></my-component>
and corresponding class mycomponent
i utilize component in html
class="lang-dart prettyprint-override"><my-component foo="bar" bar="foo"></my-component> <my-component foo="baz" bar="qux"></my-component> <my-component foo="bar" bar="baz"></my-component>
now want queryselect custom elements , access attributes directly. think this:
class="lang-dart prettyprint-override">list<mycomponent> mys = queryselector('my-component'); mys.foreach((my){ print(my.foo); my.bar = '1234'; });
there view problems code:
queryselector returns element not mycomponent. can cast element mycomponent?
is mycomponent <my-component> divelement <div>?
queryselector cannot select custom elements. advertisement class every my-component , select class. or there way?
i can access attributes my.getattribute() not my.foo. know, because still element not mycomponent.
this not officially supported. there ng-element
allowed far remember intended used unit tests. there changes in lastly versions don't know current state.
you should pass references using dependency injection, angular events (explained here how communicate between angular dart controllers) or scope access other elements.
jquery-selectors dart components angular-dart
No comments:
Post a Comment