Side multi-level menu doesn't work with Angular 8.
See original GitHub issueHello, multilevel sidebar menu does’t work on Angular 8 (TypeScript), here is the HTML code:
<li class="nav-item has-treeview">
<a href="#" class="nav-link">
<i class="nav-icon far fa-envelope"></i>
<p>
Mailbox
<i class="fas fa-angle-left right"></i>
</p>
</a>
<ul class="nav nav-treeview" data-widget="tree">
<li class="nav-item">
<a href="../mailbox/mailbox.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Inbox</p>
</a>
</li>
<li class="nav-item">
<a href="../mailbox/compose.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Compose</p>
</a>
</li>
<li class="nav-item">
<a href="../mailbox/read-mail.html" class="nav-link">
<i class="far fa-circle nav-icon"></i>
<p>Read</p>
</a>
</li>
</ul>
</li>
When I click on menu to expand, it doesn’t open as expected.
Thanks,
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Facing Css issue in multi Level Menu - angular - Stack Overflow
I am trying to build a multi level side navigation menu and i am able to complete it but some css issue is...
Read more >Create a Multi-level Drop-down Menu in Angular 11
We discuss how to create multi-level drop-down menus in JavaScript and Angular in this web development tutorial. Learn more.
Read more >ng-material-multilevel-menu - npm
Material Multi-Level Menu for Angular Projects.. Latest version: 5.5.3, last published: 2 years ago. Start using ng-material-multilevel-menu ...
Read more >Bootstrap nested (multilevel) Dropdown - free examples
Nested dropdowns built with Bootstrap 5. Tutorial & templates for multilevel navbar dropdowns menu, activated on hover or on click & much more....
Read more >Dropdown - Angular powered Bootstrap
Inputs ; open. Defines whether or not the dropdown menu is opened initially. Type: boolean. Default value: false ; placement. The preferred placement...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The markup look correct, may you need to init the treeview on page load. Try to add
$('[data-widget="treeview"]').Treeview('init');
.Guys, found the solution:
Add “node_modules/jquery/dist/jquery.min.js” and “node_modules/admin-lte/dist/js/adminlte.min.js” to “scripts” section in angular.json;
Following a sample valid markup:
<li class="nav-item has-treeview"> <a href="#" class="nav-link"> <i class="nav-icon far fa-envelope"></i> <p> Mailbox <i class="fas fa-angle-left right"></i> </p> </a> <ul class="nav nav-treeview" data-widget="tree"> <li class="nav-item"> <a href="../mailbox/mailbox.html" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>Inbox</p> </a> </li> <li class="nav-item"> <a href="../mailbox/compose.html" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>Compose</p> </a> </li> <li class="nav-item"> <a href="../mailbox/read-mail.html" class="nav-link"> <i class="far fa-circle nav-icon"></i> <p>Read</p> </a> </li> </ul> </li>
Is this approach correct? If so, I’ll close this issue.