Skip to content

Instantly share code, notes, and snippets.

@arturovt
Created May 21, 2019 18:23
Show Gist options
  • Select an option

  • Save arturovt/aef1b65e1bd75afa10c4e17383e51da6 to your computer and use it in GitHub Desktop.

Select an option

Save arturovt/aef1b65e1bd75afa10c4e17383e51da6 to your computer and use it in GitHub Desktop.
import { SelectSnapshot } from '@ngxs-labs/select-snapshot';
@Injectable({ providedIn: 'root' })
export class AuthGuard implements CanActivate {
@SelectSnapshot(AuthState)
public auth: AuthStateModel;
public canActivate(): boolean {
return this.auth.isAuthenticated;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment