模板内的角度注释属性

Tan*_*ova 4 angular-template angular

我可以在 html 标记中注释属性吗?

我需要做这样的事情:

<hero-detail 
     <!--comments goes here-->
     hero="currentHero">
</hero-detail>
Run Code Online (Sandbox Code Playgroud)

但这不起作用。怎么做到呢?

Gün*_*uer 5

这是无效的 HTML。Angular 仅适用于有效的 HTML。
HTML 注释只允许在元素外部或内部,而不能在元素本身。