salix/front/core/components/treeview/content.js

32 lines
643 B
JavaScript

import ngModule from '../../module';
class Controller {
constructor($element) {
this.$element = $element;
}
$onInit() {
this.treeview.$transclude(($clone, $scope) => {
this.$contentScope = $scope;
$scope.item = this.item;
this.$element.append($clone);
});
}
$onDestroy() {
if (this.$contentScope)
this.$contentScope.$destroy();
}
}
Controller.$inject = ['$element'];
ngModule.component('vnTreeviewContent', {
controller: Controller,
bindings: {
item: '<'
},
require: {
treeview: '^vnTreeview'
}
});