From 0bf099ec95f6af72d57b1d0330a4c3a9bca3db12 Mon Sep 17 00:00:00 2001 From: John Hoffman Date: Fri, 28 Mar 2014 12:27:20 -0600 Subject: [PATCH 1/3] added support for an orderBy attribute for the tree control --- angular-tree-control.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/angular-tree-control.js b/angular-tree-control.js index 840ff93..bfb63bd 100644 --- a/angular-tree-control.js +++ b/angular-tree-control.js @@ -108,10 +108,19 @@ return (this.$id == $scope.selectedScope)?"tree-selected" + injectSelectionClass:""; }; + // orderBy clause (if any) for template + var orderByClause = (function() { + if (angular.isDefined($scope.orderBy)) { + return " | orderBy:'" + $scope.orderBy + "'"; + } else { + return ''; + } + })(); + //tree template var template = '