category formatting

This commit is contained in:
Athou
2013-03-21 23:10:05 +01:00
parent 90289a8cf7
commit 42f9b38f68
5 changed files with 173 additions and 7 deletions

View File

@@ -7,7 +7,8 @@ module.directive('category', function($compile) {
selectedType: '=',
selectedId: '=',
feedClick: '&',
categoryClick: '&'
categoryClick: '&',
formatCategoryName: '&'
},
restrict : 'E',
replace: true,
@@ -15,7 +16,7 @@ module.directive('category', function($compile) {
link: function(scope, element) {
if (scope.node.children) {
var ul = element.find('ul');
ul.prepend('<category ng-repeat="child in node.children" node="child" feed-click="feedClick({id:id})" category-click="categoryClick({id:id})" selected-type="selectedType" selected-id="selectedId"></category>');
ul.prepend('<category ng-repeat="child in node.children" node="child" feed-click="feedClick({id:id})" category-click="categoryClick({id:id})" selected-type="selectedType" selected-id="selectedId" format-category-name="formatCategoryName({category:category})"></category>');
$compile(ul.contents())(scope);
}
}