angular comments attributes inside template

Viewed 1948

Can I comment attribute inside html markup?

I need to do something like that:

<hero-detail 
     <!--comments goes here-->
     hero="currentHero">
</hero-detail>

But this does not work. How can it be done?

2 Answers

You can not write comment in the element, but you can move your comment out of the element as below:

<!-- your comments goes here -->
<hero-detail hero="currentHero">
</hero-detail>

Or in the element as:

<hero-detail hero="currentHero">
<!-- your comments goes here -->
</hero-detail>
Related