FarmMapsLib/projects/common/src/fm/services/full-screen-guard.service.ts

23 lines
706 B
TypeScript
Raw Normal View History

2019-07-15 14:54:19 +00:00
import { Injectable } from '@angular/core';
import { CanLoad, Route, CanActivate, CanDeactivate, ActivatedRouteSnapshot, RouterStateSnapshot} from '@angular/router';
import { Store } from '@ngrx/store';
import * as appCommonReducer from '../reducers/app-common.reducer'
import * as appCommonActions from '../actions/app-common.actions';
2019-11-05 16:19:33 +00:00
@Injectable({
providedIn: 'root',
})
2019-07-15 14:54:19 +00:00
export class FullScreenGuard implements CanActivate {
private loginDispatched = false;
constructor(private store: Store<appCommonReducer.State> ) { }
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
this.store.dispatch(new appCommonActions.FullScreen());
return true;
}
}