<div ng-if="true">visible</div>很容易,但由于ngIf甚至可以在评论中使用,</div>评论块的结束是什么?
试过,没有运气:
<!-- ng-if: true -->
....
<!-- ng-if -->
Run Code Online (Sandbox Code Playgroud)
谢谢.
我在angularjs中找到了很好的功能.可以将指令设置为对注释起作用.
{
...
restrict: 'M'
...
}
Run Code Online (Sandbox Code Playgroud)
这就是文档中所说的诀窍.该指令的用法如下:
<!-- directive: my-directive-name -->
Run Code Online (Sandbox Code Playgroud)
只要我不需要将参数传递给该指令,它就可以正常工作.是否可以将指令上的参数设置为仅限于注释?语法是什么?