0
下面是HTML爲什麼在預計1時有2個`alert`消息?
<div ng-app = 'myApp'>
<div class='some'>
</div>
</div>
角代碼如下: -
<script>
var myApp = angular.module('myApp', []);
myApp.directive('some', function() {
alert('hi');
return {
restrict: 'C',
link: linkFN,
}
});
</script>
這是jsfiddle