Last active
August 29, 2015 14:02
-
-
Save almaron/77da9ce65cb2679d35f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.filter("filterTree", [ | |
"$filter", function($filter) { | |
return function(tree) { | |
var newTree = []; | |
angular.forEach(tree, function(node, index) { | |
var newNode; | |
newNode = { | |
id: node.id, | |
sort_order: index, | |
children: $filter('filterTree')(node.children) | |
}; | |
newTree.push(newNode); | |
}); | |
return newTree; | |
}; | |
} | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment