-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(menu): allow to add custom menu links
- Loading branch information
Alex Malkevich
committed
Mar 12, 2019
1 parent
ddc4a91
commit 5200932
Showing
5 changed files
with
338 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,35 @@ | ||
import { ChangeDetectionStrategy, Component } from '@angular/core'; | ||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; | ||
import { DynamicMenuService } from 'projects/dynamic-menu/src/public_api'; | ||
|
||
@Component({ | ||
selector: 'app-root', | ||
templateUrl: './app.component.html', | ||
styleUrls: ['./app.component.css'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class AppComponent {} | ||
export class AppComponent implements OnInit { | ||
constructor(private dynamicMenuService: DynamicMenuService) {} | ||
|
||
ngOnInit(): void { | ||
this.dynamicMenuService.addMenuAfter(['path3', ':id', 'path6'], { | ||
path: 'custom-path', | ||
data: { menu: { label: 'Custom Section' } }, | ||
}); | ||
this.dynamicMenuService.addMenuToStart(['path3', ':id', 'path6'], { | ||
path: 'custom-path2', | ||
data: { menu: { label: 'Custom Section - Start' } }, | ||
}); | ||
this.dynamicMenuService.addMenuToEnd(['path3', ':id', 'path6'], { | ||
path: 'custom-path3', | ||
data: { menu: { label: 'Custom Section - End' } }, | ||
}); | ||
this.dynamicMenuService.addMenuToStart([''], { | ||
path: 'custom-path-start', | ||
data: { menu: { label: 'Custom Section - Start' } }, | ||
}); | ||
this.dynamicMenuService.addMenuToEnd([''], { | ||
path: 'custom-path-end', | ||
data: { menu: { label: 'Custom Section - End' } }, | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.