は、私が入ってくるparametesの依存要素にクラスを設定するカスタムディレクティブ角度JS書き込もうとしました:ディレクティブがクラスを設定しない理由は何ですか?
angular.module('hello', [])
.directive("testCase", function(){
return {
restrict: 'A',
scope: {
'condition': '='
},
link: function (scope, element, attrs) {
switch (scope.condition) {
case "pending":
element.css('color', 'yellow');
break;
case 'active':
element.css('color', 'green');
break;
case "archived":
case "finished":
case "completed":
element.css('color', 'gray');
break;
}
}
}
});
をしかし、私は「アクティブ」
そのディレクトリではありません。 – Sajeetharan