0
我以前創建的元素,dierectives。我只是想創建一個簡單的元素dierective。這是它最簡單的形式:爲什麼我的屬性的指令不會被觸發?
.directive('gdShow', function(){
return{
restrict: 'A',
link: function(scope, elem, attrs){
console.log('elem');
},
};
});
這是我嘗試調用它:
<div gdShow="test" class="wrapper">
"stuff"
</div>
這適用於我的元素的指令,而不是這一個,爲什麼?
+1沒有離開無法解決的問題。另外請注意,它的標準使用小寫字母('GD-show')。 – Stewie