这是一个Bug,还是有文档说明不要在指令名称中使用后缀“start”?只有“finish”指令有效。
HTML:
<html ng-app="myApp">
...
<body>
<h2>Angular doesn't like the suffix 'start'</h2>
<div this-is-the-start="abc"></div>
<div this-is-the-finish="abc"></div>
</body>
...
</html>
JS:
var myApp = angular.module('myApp',[]);
myApp.directive('thisIsTheFinish', function() {
return {
restrict: 'A',
template: 'finish'
}
});
myApp.directive('thisIsTheStart', function() {
return {
restrict: 'A',
template: 'start'
}
});