我有这个指令
MyApp.directive('dynatree', function ($rootScope) {
return {
restrict: 'E',
link: function postlink(scope, element, attrs) {
$(element).dynatree({
onActivate: function (node) {
scope.$emit('nodeActivated', node);
},
persist: false,
children: scope.treeData //this variable is in the layout for either csb or sku
});
}
};
});
我的控制器包含儿童的值:
scope.treeData = [ ... ]
每次我更新 scope.treeData,我的指令都不会更新。有谁知道如何从我的控制器更新我的指令?
谢谢