本文整理汇总了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) => {