refresh category tree when a category is removed

This commit is contained in:
Athou
2013-05-01 14:38:37 +02:00
parent 3ff21b0dbd
commit fb881ff3bb
2 changed files with 5 additions and 3 deletions

View File

@@ -91,7 +91,9 @@ function($scope, FeedService, CategoryService) {
};
$scope.saveCategory = function() {
CategoryService.add($scope.cat);
CategoryService.add($scope.cat, function() {
CategoryService.init();
});
$scope.closeCategory();
};
}]);

View File

@@ -92,8 +92,8 @@
<div class="control-group" ng-class="{error : !categoryForm.category.$valid}">
<label class="control-label">Parent</label>
<div class="controls">
<select name="category" ng-model="cat.parentId" class="input-block-level" required>
<option ng-repeat="cat in CategoryService.flatCategories" value="{{cat.id}}">{{cat.name}}</option>
<select name="category" ng-model="cat.parentId" class="input-block-level"
ng-options="cat.id as cat.name for cat in CategoryService.flatCategories"required>
</select>
<span class="help-block" ng-show="!categoryForm.category.$valid">Required</span>
</div>