我有一个警卫检查状态是否有令牌。
canActivate(): boolean {
const token = this.store.selectSnapshot((state: AuthenticationState) => state.token);
if (!token) {
return true;
}
this.router.navigate(['home']);
return false;
}
然后我有这样的事情:
export class AuthenticationState {
@Selector()
static token(state: AuthenticationStateModel) {
return state.token;
}
}
我得到一个错误。“AuthenticationState”类型上不存在属性“令牌”