forked from angular-ui-tree/angular-ui-tree
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuiTreeHandle.js
More file actions
27 lines (26 loc) · 784 Bytes
/
uiTreeHandle.js
File metadata and controls
27 lines (26 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(function () {
'use strict';
angular.module('ui.tree')
.directive('uiTreeHandle', ['treeConfig',
function (treeConfig) {
return {
require: '^uiTreeNode',
restrict: 'A',
scope: true,
controller: 'TreeHandleController',
link: function (scope, element, attrs, treeNodeCtrl) {
var config = {};
angular.extend(config, treeConfig);
if (config.handleClass) {
element.addClass(config.handleClass);
}
// connect with the tree node.
if (scope != treeNodeCtrl.scope) {
scope.$nodeScope = treeNodeCtrl.scope;
treeNodeCtrl.scope.$handleScope = scope;
}
}
};
}
]);
})();