IMPORTANT!
This forum is now archived. Click here for the New Support Forum
Problem with the mat accordion
Quote from Ingo on September 2, 2019, 10:40 pmHi,
I use a mat accordion as well as in the Setting Module. But I want to prevent, then reopen the last displayed fragment is displayed again.
How can I prevent this?
I tried in dialogRef.afterClosed () withconst pathWithoutHash = this.location.path (false); this.location.replaceState (pathWithoutHash);to remove the fragment. The url will now display correctly, but when I open the dialog again, the last opened panel is displayed again.
Hi,
I use a mat accordion as well as in the Setting Module. But I want to prevent, then reopen the last displayed fragment is displayed again.
How can I prevent this?
I tried in dialogRef.afterClosed () with
const pathWithoutHash = this.location.path (false); this.location.replaceState (pathWithoutHash);
to remove the fragment. The url will now display correctly, but when I open the dialog again, the last opened panel is displayed again.
Quote from Eben Monney on September 3, 2019, 5:50 amHi,
This line from settings.component.ts opens the appropriate feature based on the value of the url fragment. You can edit it to achieve your required behavior
ngOnInit() { this.fragmentSubscription = this.route.fragment.subscribe(anchor => { switch ((anchor || '').toLowerCase()) { case 'preferences': this.preferencesPanel.open(); break; default: this.profilePanel.open(); } }); }Also you can use something like
this.panelName.open()
inngOnInit
to always force open a particular panel when displaying your panelsRegards,
Eben Monney
Hi,
This line from settings.component.ts opens the appropriate feature based on the value of the url fragment. You can edit it to achieve your required behavior
ngOnInit() { this.fragmentSubscription = this.route.fragment.subscribe(anchor => { switch ((anchor || '').toLowerCase()) { case 'preferences': this.preferencesPanel.open(); break; default: this.profilePanel.open(); } }); }
Also you can use something like this.panelName.open()
in ngOnInit
to always force open a particular panel when displaying your panels
Regards,
Eben Monney
IMPORTANT!
This forum is now archived. Click here for the New Support Forum