NARIK
Search…
09.-Navigation-Service
Angular Navigation Service(routing) is limited to outlets. We tried a lot to extend Angular Routing. But decided to write our own Navigation Service. With Narik Navigation Service you can have multiple NavigationProvider. Everyone is registered by a key and has its own behaviour on navigation request. For example currently Narik implements two NavigationProvider.
  • NarikRouteNavigationProvider
    Acts as Angular Routing.
  • NarikDialogNavigationProvider
    Whenever a navigation request received, it displays requested view, in a dialog.
It can be extended with many different NavigationProvider. Like Tab NavigationProvider and...
NavigationService is the manager if NavigationProviders. It collects all provided NavigationProviders and uses then.
Example:
1
export class test{
2
@NarikInject(NavigationService)
3
4
someMethod()
5
{
6
navigationService: NavigationService;
7
this.navigationService
8
.navigate(
9
["../" + this.config.entityKey],
10
"dialog",
11
{
12
relativeTo: this.route
13
},
14
data
15
)
16
.then((d: DialogRef<any>) => {
17
d.events
18
.pipe(filter(x => x.eventType === "ENTITY_UPDATED"))
19
.subscribe(x => {
20
this.refresh();
21
});
22
});
23
}
24
}
Copied!
If you create new NavigationProvider, you should provide it in your module providers.
1
{
2
provide: NavigationProvider,
3
useClass: NewNavigationProvider,
4
multi: true
5
}
Copied!
Last modified 7mo ago
Copy link