0
我创建这样角运动范围变量指令
.directive('optionLabel', function() {
'use strict';
return {
replace: true,
restrict: 'AE',
template: '<div class="error-msg col-xs-12 intelligent-group col-centered"><h1 translate>{{ optionLabel }}</h1></div>'
};
})
一个指令眼下范围optionLabel在每个使用该指令作为这样的控制器的设置。
$scope.optionLabel = labelService.getOptionLabel(search.searchType);
我该如何直接在指令中设置它,而不是在5个控制器中重复执行此代码?
完美谢谢柯莫 – StevieB 2015-03-25 11:56:14