<分区>
为什么在 return 下括号跟随时 angular 指令不起作用?
app.directive("alert", function () {
return
{
restrict: "EA",
template: "<div>Alert!!</div>"
};
});
但是当括号与返回相邻时确实有效:
app.directive("alert", function () {
return {
restrict: "EA",
template: "<div>Alert!!</div>"
};
});