HB.Core.Directives.directive('hbMultiselect', [
function() {
return {
restrict: 'E',
templateUrl: '/hb-core/library/directives/hb-multiselect/hb-multiselect-ptl.html',
scope: {},
controllerAs: '$ctrl',
bindToController: {
optionsData: '<',
optionsSelected: '=',
allSubtypesSelected: '='
},
controller: function() {
var $ctrl = this;
// $ctrl.$onInit = function() {
// console.log(this); // Tried this... didn't work either
// };
function init() {
$ctrl.isExpanded = false;
$ctrl.optionsDisplay = [];
$ctrl.tags = [];
console.log("------")
console.log($ctrl);
console.log("------")
>>>>>>>>>>>>>>>>>>>>**BREAK POINT HERE**
}
init();
}
};
}
]);
bindingsoptionsData
和optionsSelected
allSubtypesSelected 正在按预期工作。但是由于某种原因,当我在代码中放置断点(在上面的代码中指定)时,我得到以下
我什么都没改变!我的代码不起作用,因为当我调试代码时 $ctrl.optionsData 未定义,但我不知道为什么。