Closed
Description
export class DefaultLayoutComponent implements OnDestroy, OnInit {
ngOnInit(): void {
this.navItems = navItems;
setTimeout(() => {
this.navItems = [{
name: 'a',
url: 'b'
}];
}, 3000);
}
}
For the above code, the component will prepend an item instead of replacement.
Is this behavior intended or a bugs?
For semantic meaning, reassigning variables seems to be referring to replacement instead of prepend.
Thanks
Activity
emilynielson commentedon Dec 26, 2018
I'm having the same issue. Is there a way to reassign it and get the navbar to only show the reassignment?
refactor: drop `Replace`
xidedix commentedon Feb 15, 2019
@nealyip @emilynielson
please update
@coreui/angular
dependency to2.4.1
and let us know if this helps
pranavs1791 commentedon Mar 29, 2019
Hi i updated @coreui/angular to @2.4.5 . But still the issue persists. I can't reassign the navItems . The value i change in my .ts file doesn't get affected in my template file.
xidedix commentedon Mar 29, 2019
hi @pranavs1791
Please try to use this code example for quick and dirty verification whether dynamic reassign of sidebar items works or not.
What you need is to create some sort of sidebar-nav.service to reassign navItems array on the fly and subscribe the result in default-layout.component
github-actions commentedon May 16, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions