|
|
@ -1,6 +1,8 @@ |
|
|
import { Injectable } from '@angular/core'; |
|
|
import { Injectable } from '@angular/core'; |
|
|
import { Store } from '@ngxs/store'; |
|
|
import { Store } from '@ngxs/store'; |
|
|
import { LayoutState } from '../states/layout.state'; |
|
|
import { LayoutState } from '../states/layout.state'; |
|
|
|
|
|
import { AddNavigationElement, RemoveNavigationElementByName } from '../actions'; |
|
|
|
|
|
import { Layout } from '../models/layout'; |
|
|
|
|
|
|
|
|
@Injectable() |
|
|
@Injectable() |
|
|
export class LayoutStateService { |
|
|
export class LayoutStateService { |
|
|
@ -9,4 +11,12 @@ export class LayoutStateService { |
|
|
getNavigationElements() { |
|
|
getNavigationElements() { |
|
|
return this.store.selectSnapshot(LayoutState.getNavigationElements); |
|
|
return this.store.selectSnapshot(LayoutState.getNavigationElements); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dispatchAddNavigationElement(payload: Layout.NavigationElement | Layout.NavigationElement[]) { |
|
|
|
|
|
return this.store.dispatch(new AddNavigationElement(payload)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
dispatchRemoveNavigationElementByName(name: string) { |
|
|
|
|
|
return this.store.dispatch(new RemoveNavigationElementByName(name)); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|