angularjs - AngularDart: Component attribute -
i'm new angular , have following problem.
i'm trying create component can active
. set detects if attribute called active
exists , sets internal state accordingly.
<page active page-id="page-1"></page>
the problem emerged when wanted remove active state. how should go it? should switch css classes? or maybe use directive?
this seems little 'hacky' but, first need element somehow , access attribute map directly , remove like,
html
<page active page-id="page-1" id="page_one"></page>
dart
queryselector('#page_one').attributes.remove("active");
https://api.dartlang.org/apidocs/channels/be/dartdoc-viewer/dart:html.element#id_attributes
Comments
Post a Comment