0
我無法結合的控制器陣列具有指令:綁定陣列控制器/指令
標記:
<custom-directive item="tag" selectedItems="selectedArray" ng-repeat="tag in tags"></custom-directive>
控制器:
$scope.selectedArray= [];
指令:
scope: {
item:"=",
selectedItems:"="
},
controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
//Undefined
console.log($scope.selectedItems);
}
綁定項目工作正常,我在做錯selectedItems?
感謝