3

Please forgive me my ignorance but I am new in Angular. Was googling how to make a sidebar navigation component with multi-child nodes. Obviously, everything is driven by JSON so we don't know how many child nodes there will be.

I can see that it's a difficult matter to monitor the state of each menu item with child nodes which can also have multiple children with children of their own :)

Looked into templates to see how other pros are doing it and that they using a single drop-down menu or using jquery: https://genesisui.com/demo/?template=prime&version=1.8.14&framework=bootstrap4-angular5

Is there a reason why devs are going with jquery? Seems like a little bit of overkill for few small functionalities.

Can you point me in the right direction of multi-level drop-down sidebar nav component done well?

Should you use jquery in Angular App?

*I know this is a super long question/s

Daniel
  • 815
  • 1
  • 6
  • 13
  • You can use recursive in angular template using ng-template. https://stackoverflow.com/a/43836403/5246199 – Parth Savadiya Jun 04 '18 at 05:47
  • It's not necesary use ng-template to make recursive, see e.g. https://stackoverflow.com/questions/50655012/angular-5-display-nested-questions-and-answer-show-item-under-it-parent-item/50655245?noredirect=1#comment88320898_50655245. And yes, generally it's a bad idea mixing jQuery and Angular, and it's not necesary, you can use mat-library or ng-bootstrap – Eliseo Jun 04 '18 at 06:39

2 Answers2

3

I will never go with jquery for any reason jquery doesn't work very well with angular you'll end up fixing a lot of bugs to try make it work , for this case I been use primeng component it is a libray with over 80 component and there is some of component related to menu .

Muhammed Albarmavi
  • 23,240
  • 8
  • 66
  • 91
2

Albarmawi's answer is right. I've applied Jquery in angular 2 once, and all things get messed up with a lots of bug come right after :D. Beside, there's not much things necessary to use with Jquery in angular 2, because you can use the ngModel for almost all of the selector