为什么在return后面跟随括号时,angular指令无法工作?
app.directive("alert", function () {
return
{
restrict: "EA",
template: "<div>Alert!!</div>"
};
});
但是当括号紧邻着返回语句时,它确实起作用:
app.directive("alert", function () {
return {
restrict: "EA",
template: "<div>Alert!!</div>"
};
});