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();
}
};
}
]);
ブレークポイント
なしでコードを実行すると、これが得られます
bindings optionsData
、optionsSelected
および allSubtypesSelected` は期待どおりに機能しています。しかし、何らかの理由でコード(上記のコードで指定) にブレークポイントを設定すると、次のようになります。
私は何も変わっていません!コードをデバッグすると $ctrl.optionsData が定義されていないため、コードが機能しませんが、その理由がわかりません。