Please check https://github.com/webpolis/angular-treecursive 

It might be of help.

Cheers.
Nicolas Iglesias

On Wednesday, June 11, 2014 4:22:44 AM UTC-3, Ahmed Al-Shwafi wrote:
>
> Hi Guys,
>
> I want to create a general purpose recursive directive that can repeat a 
> template recursively. This will allow me to avoid creating a new directive 
> for every usecase of a recursive directive.
>
> *Explain :*
> The recursive template is defined in "Recursive" directive, the 
> "RecursivePlaceholder" directive is where the recursion will happen and it 
> should be replaced by the content of "Recursive" directive.
>
>
> *Example :*
>         <div ng-app="app" ng-controller="Ctrl">
>             <recursive input="data" ouput="categories">
>                 <select ng-model="selected" ng-options="cat.name for cat 
> in categories"></select> <recursive-placeholder input="cat.children" 
> output="categories" ng-if="selected && 
> selected.children.length"></recursive-placeholder>
>             </recursive>
>             <script>
>                 var app = angular.module('app',[]);
>                 
>                 app.controller('Ctrl',function($scope){
>                     $scope.data = [
>                         {name:'Cars',children:[
>                                 {name:'Toyota'},
>                                 {name:'Honda'}
>                         ]},
>                         {name:'Electronics',children:[
>                                 {name:'Printers'},
>                                 {name:'Mobiles'},
>                                 {name:'Computers',children:[
>                                         {name:'PC'},
>                                         {name:'Mac'}
>                                 ]}
>                         ]}
>                     ];
>                 });
>             </script>
>         </div>
>
> Thanks,,,
> Al-Shwafi
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to