I have a guard that checks if there is a token on state.
canActivate(): boolean {
const token = this.store.selectSnapshot((state: AuthenticationState) => state.token);
if (!token) {
return true;
}
this.router.navigate(['home']);
return false;
}
Then I have something like this:
export class AuthenticationState {
@Selector()
static token(state: AuthenticationStateModel) {
return state.token;
}
}
I get an error. Property 'token' does not exist on type 'AuthenticationState'