angular-material-accordion | A simple accordionfor Angular Material
kandi X-RAY | angular-material-accordion Summary
kandi X-RAY | angular-material-accordion Summary
This is a package to create navigation menus using Angular Material. This follows all the design guidelines provided by Google Material spec.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of angular-material-accordion
angular-material-accordion Key Features
angular-material-accordion Examples and Code Snippets
Community Discussions
Trending Discussions on angular-material-accordion
QUESTION
I am using mat-accordion
with router-outlet
and observing a strange behaviour. Below is a sample implementation of my use case.
https://stackblitz.com/edit/angular-material-accordion-with-router
In this example, panel 3 component and panel 4 component are having router-outlet
.
Now in first time navigation it works as expected. But if I collapse those panels and again try to open them I find that content of panel 4 gets reflected in panel 3.
I am not sure if its a bug in angular-router
or am I doing something wrong here.
ANSWER
Answered 2019-Jul-03 at 16:00You've mixed up routes and outlets with non-routes and components. Routes are used to display specified components in outlets, and your template uses those same components. You should only be doing one or the other - either place the component in the template directly or use a route to display it in an outlet.
Your template places all four 'panel' components on the page, and two of them (3 and 4) define outlets. Therefore you have two outlets on your page. Since they are not named, they are both trying to be the default or 'primary' outlet for your router, so any routing that is not directed at a named outlet (which is all of your routing) goes to one of those (or maybe both - I don't know how Angular handles this).
You are also using routes for components that aren't routes (panels 1 and 2). For example, if you open your panel 1, and then open the DOM inspector, you will see another panel 1 component in the outlet for either panel 3 or 4.
The fix is to remove the components that are not actual routes from the routing - 'panel1' and 'panel2', and to name the two outlets and target those outlets using the router and link configurations.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install angular-material-accordion
bower install angular-material-accordion
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page