in the app I’m working on I need to render a table of contents but initially I don’t know how many levels it will have:
so,to be able to do this I found two options:
- The easier one is to create the structure in the controller and then with ng-bind-html paste it in the template. But this one, I don’t know why, when I use the $compile angular method to make the ion tags take form, the links never works.
- The other one is using the ng-repeat in the template. I tries to encapsulate the html info inside an object and then I tried to iterate it in the template with a ng-repeat. Here is where I found the problem, when I initialize the template I don’t know how many levels my table of contents will have so I can’t “pre-write” the template.
Does anyone faced the same problem?
Wish to hear from you soon.
Thank you very much