我知道我能做到: <my-directive attr="myAttr"></my-directive> 然后通过my-directive端访问attr。 但我想做这样的事情: <my-directive attr="myAttr">
<a href="">Some link that will apply with the my-directive directive too</a>
</my-directive> 这个是可能的吗?
我的代码:
app.directive('abcabc', function (){ alert('directive');}); // working
但
app.directive('abcAbc', function (){ alert('directive');}); // not working !
app.directive('abc-abc', function (){ alert('directive');}); // not working !
我做错了吗?或者,Angular指令
我在文档和Closure.java中看到了对“指令”的引用,但没有解释它是什么或它的目的是什么,
public static final int DONE = 1, SKIP = 2;
private int directive;
/**
* @return Returns the directive.
*/
public int getDirective() {
return directive;
}
/**
* @param directive The directive to set.
*/
public void setDirective(int directive)
语法错误
type directive = TurnLeft | TurnRight | StepForward of int | StepBackward of int
type path = directive list
let sample_path = (StepForward 1 :: StepForward 2 :: TurnLeft:: StepBackward 3 :: TurnLeft :: StepForward 1 ::[])
let inverse directive =
if directive =TurnLeft then TurnRight
else if d