In Angular2
is there a way for developer to check if the corresponding element of one component is tagged with some attribute/class or not?
Say we have below html:
<outer-controller>
<label label-directive class='dynamically-set-class' dynamically-set-attribute>just some label</label>
</outer-controller>
The label-directive
marked in the label element is a Angular2
component, the two dynamically-set-class
and dynamically-set-attribute
are dynamically controlled by the outer-controller
basing on user input.
Every time the outer-controller
reset the class of the label or the attribute, it fire a event that caught by label-directive
and so the label-directive
should do something dynamically base on the run-time attribute/class setting.
However, I cannot find any example in existing official Angular2
doc