Recursion with ng-repeat in Angular

前端 未结 10 1279
心在旅途
心在旅途 2020-12-15 19:17

I have the following data structure for items in my sidemenu, in an Angular app based on a paid-for web site theme. The data structure is my own, and the menu is derived fro

10条回答
  •  甜味超标
    2020-12-15 19:49

    In order to make recursion in Angular, I would love to use the basic feature of angularJS and i.e directive.

    index.html

    
    

    recMenu.html

    
    

    recMenu.html

    angular.module('myApp').component('recMenu', {
      templateUrl: 'recMenu.html',
      bindings: {
        menuItems: '<'
      }
    });
    

    Here is working Plunker

提交回复
热议问题