我写了一个带隔离范围的指令.
app.directive('myDirective',function() { return { restrict: 'E',scope { attr1: '@',attr2: '@',novalueAttr: // what to put here? },link: function(scope,elem,attrs) { // how to check here if novalueAttr is present in mark-up? } }; });
HTML可能是
<my-directive attr1='...' attr='...' ... no-value-attr>
要么
<my-directive attr1='...' attr='...' >