2019-10-02 07:54:52 +00:00
|
|
|
import ngModule from '../../module';
|
|
|
|
|
|
|
|
class Controller {
|
|
|
|
constructor($element) {
|
|
|
|
this.$element = $element;
|
|
|
|
}
|
|
|
|
|
|
|
|
$onInit() {
|
2019-10-04 10:20:49 +00:00
|
|
|
this.treeview.$transclude(($clone, $scope) => {
|
|
|
|
this.$contentScope = $scope;
|
2019-10-02 07:54:52 +00:00
|
|
|
$scope.item = this.item;
|
2019-10-04 10:20:49 +00:00
|
|
|
this.$element.append($clone);
|
2019-10-02 07:54:52 +00:00
|
|
|
});
|
|
|
|
}
|
2019-10-04 10:20:49 +00:00
|
|
|
|
|
|
|
$onDestroy() {
|
|
|
|
if (this.$contentScope)
|
|
|
|
this.$contentScope.$destroy();
|
|
|
|
}
|
2019-10-02 07:54:52 +00:00
|
|
|
}
|
|
|
|
Controller.$inject = ['$element'];
|
|
|
|
|
|
|
|
ngModule.component('vnTreeviewContent', {
|
|
|
|
controller: Controller,
|
|
|
|
bindings: {
|
2019-10-02 12:12:17 +00:00
|
|
|
item: '<'
|
|
|
|
},
|
|
|
|
require: {
|
|
|
|
treeview: '^vnTreeview'
|
2019-10-02 07:54:52 +00:00
|
|
|
}
|
|
|
|
});
|