Matteo Scandolo | f2c3ed6 | 2016-12-15 14:32:50 -0800 | [diff] [blame] | 1 | export interface IXosNavigationRoute { |
| 2 | label: string; |
| 3 | state?: string; |
| 4 | url?: string; |
| 5 | } |
| 6 | |
| 7 | export interface IXosNavigationService { |
| 8 | query(): IXosNavigationRoute[]; |
| 9 | add(route: IXosNavigationRoute): void; |
| 10 | } |
| 11 | |
| 12 | export class NavigationService { |
| 13 | private routes: IXosNavigationRoute[]; |
| 14 | |
| 15 | constructor() { |
| 16 | this.routes = [ |
| 17 | { |
| 18 | label: 'Home', |
| 19 | state: 'xos.dashboard' |
| 20 | } |
| 21 | ]; |
| 22 | } |
| 23 | |
| 24 | query() { |
| 25 | return this.routes; |
| 26 | } |
| 27 | |
| 28 | add(route: IXosNavigationRoute) { |
| 29 | this.routes.push(route); |
| 30 | } |
| 31 | } |