refactored a little bit

This commit is contained in:
Athou
2013-04-30 22:20:39 +02:00
parent e01da0645d
commit f9aa4995f9
4 changed files with 11 additions and 8 deletions

View File

@@ -237,11 +237,14 @@ module.controller('CategoryDetailsCtrl', ['$scope', '$state', '$stateParams', 'F
$scope.CategoryService = CategoryService;
CategoryService.get(function() {
for(var i = 0; i < CategoryService.flatCategories.length; i++){
for (var i = 0; i < CategoryService.flatCategories.length; i++) {
var cat = CategoryService.flatCategories[i];
if (cat.id == $stateParams._id) {
$scope.category = angular.copy(cat);
$scope.category.name = $scope.category.origName;
$scope.category = {
id: cat.id,
name: cat.orig.name,
parentId: cat.orig.parentId,
}
break;
}
}