Skip to content

prune old route check #63

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

Merged
merged 1 commit into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export class FsNavFrameSidebarItemComponent implements OnInit {
@ViewChild(TemplateRef) template: TemplateRef<any> | undefined;

closed: boolean = this.frameService.menuState == MenuState.CLOSED;
isActivePath: string = '';

constructor(public frameService: FsNavFrameService) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@
<div class="sidebar" [class.opened]="!isClosed">
<!-- Navigation -->
<ng-content select="fs-nav-frame-sidebar" [opened]="!isClosed"></ng-content>
<!-- <mat-nav-list dense>
<mat-list-item>
<a mat-list-item href="">Home</a>
</mat-list-item>
<mat-list-item>
<a mat-list-item href="">Test</a>
</mat-list-item>
</mat-nav-list> -->

<!-- User Profile -->
<ng-content select="fs-nav-user-profile"></ng-content>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,8 @@ export class FsNavFrameComponent implements OnInit, OnDestroy {

profileContentElement!: HTMLElement | null;
isClosed: boolean = true;
isActivePath: string = '';

constructor(
private elementRef: ElementRef,
private frameService: FsNavFrameService,
private router: Router,
private activatedRoute: ActivatedRoute,
private titleService: Title
) {}
constructor(private elementRef: ElementRef, private frameService: FsNavFrameService, private titleService: Title) {}

ngOnInit(): void {
this.frameService.menuStateEvent.subscribe((state: MenuState) => {
Expand All @@ -49,20 +42,6 @@ export class FsNavFrameComponent implements OnInit, OnDestroy {
}
}
});

this.router.events
.pipe(
filter(event => event instanceof NavigationEnd),
map(() => {
const child = this.activatedRoute.firstChild;
return child;
})
)
.subscribe((ttl: ActivatedRoute | null) => {
ttl?.url.subscribe(obj => {
this.isActivePath = obj[0].path;
});
});
}

ngAfterViewInit() {
Expand All @@ -82,8 +61,4 @@ export class FsNavFrameComponent implements OnInit, OnDestroy {
this.frameService.switchMenuState();
}
}

isNavActive(name: string): boolean {
return name === this.isActivePath;
}
}