0
我已經創建了需要HTML元素的AngularJS指令: 1)成爲窗體的子項; 2)具有'條件值'屬性;如何在AngularJS指令中設置所需屬性列表?
要做到這一點,我創建指令是這樣的:
.directive('onFocusoutDoSomething', function() {
return {
require : ['^?form', '^conditionalValue'],
restrict : 'A',
link : function(scope, element, attrs, ctrl) {
// ... do something
}
}
})
但由於某些原因,我得到這個異常: 控制器「conditionalValue」,由指令所要求的「onFocusoutDoSomething」,不能被發現!
駱駝案件指令的名稱和屬性被AngularJS的破折號案件取代,對嗎?