Skip to content

app-sidebar-nav navItems reassignment #126

Closed
@nealyip

Description

@nealyip
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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions