-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
SideNavBar classes and attributes are not updating dynamically #180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@rangeranger
|
@xidedix : Tried that. With or without async pipe, class and attribute values are not applying if they are changed after it is loaded. |
@rangeranger have you seen this: #161 (comment) |
@rangeranger |
@xidedix : Thanks a lot, Sir. You saved my day. Deep clone solved the problem. I didn't know a nested array of objects needed a deep clone to let Angular know it has changed. I thought arrays/array of objects doesn't need a deep clone. Without a deep clone, the name is changing but just attributes and classes are not changing. Still wondering why the name is changing and not others without a deep clone. Thanks again. |
@xidedix: Also, it will be very helpful if you can add a data property to INavData Interface to store roles/privileges (developer-defined data) as we have in Angular Route Interface (https://angular.io/api/router/Route#data). |
@rangeranger
BTW you can pass any html {
name: 'Dashboard',
url: '/dashboard',
icon: 'icon-speedometer',
attributes: {'data-role': 'admin' }
}, or pass a {
name: 'Dashboard',
url: '/dashboard',
icon: 'icon-speedometer',
linkProps: { state: { hello: 'world' }}
}, |
@rangeranger @xidedix Hello, I am having the same issue where I'm trying to update the Badge for an Item in the Side Nav, could you post the solution you did through 'Deep Clone' please. |
I'm using
After loading the default-layout.component and after some time, If I update the class or attributes values of the existing data then it is not reflecting in the side navbar.
Like say if I have the below code initially
After sometime, If I update the navItems file like this
Then it is not adding the attributes {hidden: true} to the Dashboard and class mt-3 to the Report. But, If I change the name from Dashboard to Dash then it is updating.
The text was updated successfully, but these errors were encountered: