diff --git a/angular-tree-control.js b/angular-tree-control.js index 3043027..a272401 100644 --- a/angular-tree-control.js +++ b/angular-tree-control.js @@ -275,15 +275,6 @@ if (typeof module !== "undefined" && typeof exports !== "undefined" && module.ex }; // return "" + $scope.orderBy; - var templateOptions = { - orderBy: $scope.orderBy ? " | orderBy:orderByFunc():isReverse()" : '', - ulClass: classIfDefined($scope.options.injectClasses.ul, true), - nodeChildren: $scope.options.nodeChildren, - liClass: classIfDefined($scope.options.injectClasses.li, true), - iLeafClass: classIfDefined($scope.options.injectClasses.iLeaf, false), - labelClass: classIfDefined($scope.options.injectClasses.label, false) - }; - var template; var templateUrl = $scope.options.templateUrl || treeConfig.templateUrl; @@ -291,20 +282,32 @@ if (typeof module !== "undefined" && typeof exports !== "undefined" && module.ex template = $templateCache.get(templateUrl); } + $scope.templateClass = function(className) { + return classIfDefined($scope.options.injectClasses[className]); + }; + + $scope.templateOrderBy = function() { + return $scope.orderBy ? " | orderBy:orderByFunc():isReverse()" : ''; + }; + + $scope.templateNodeChildren = function() { + return $scope.options.nodeChildren || "children"; + }; + if(!template) { template = - ''; } - this.template = $compile($interpolate(template)({options: templateOptions})); + this.template = $compile($interpolate(template)()); }], compile: function(element, attrs, childTranscludeFn) { return function ( scope, element, attrs, treemodelCntr ) {