本文整理匯總了TypeScript中src/app/services/auth.service.AuthService類的典型用法代碼示例。如果您正苦於以下問題:TypeScript service.AuthService類的具體用法?TypeScript service.AuthService怎麽用?TypeScript service.AuthService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了service.AuthService類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: constructor
constructor(private auth: AuthService) {
auth.handleAuthentication();
}
示例2: ngOnInit
ngOnInit() {
if (this.auth.userProfile) {
this.profile = this.auth.userProfile;
} else {
this.auth.getProfile((err, profile) => {
this.profile = profile;
});
}
}
示例3: ngOnInit
ngOnInit() {
this.authService.currentUserAsP()
.then( (current) => this.authService.getUser(current.uid).pipe(first()).toPromise())
.then( (user: User) => {
this.authService.setCurrentUser(user);
return this.companyService.retriveCompany(user.companyId).pipe(first()).toPromise();
}).then((company) => {
this.companyService.setCompany(company);
})
.catch((error) => console.log(error));
}
示例4:
x => {
this.status = this.authservice.getLogin();
}
示例5: logOut
logOut() {
this.authService.logOut();
}
示例6: logIn
logIn(value) {
this.authService.logIn(value);
}
示例7: logout
logout(){
this.auth.logout();
}
示例8: login
login(){
this.auth.login();
}
示例9:
.then( (user: User) => {
this.authService.setCurrentUser(user);
return this.companyService.retriveCompany(user.companyId).pipe(first()).toPromise();
}).then((company) => {