本文整理汇总了TypeScript中ng2-adal/core.AdalService类的典型用法代码示例。如果您正苦于以下问题:TypeScript AdalService类的具体用法?TypeScript AdalService怎么用?TypeScript AdalService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AdalService类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: constructor
constructor(private adalService: AdalService, private bookingService: BookingService) {
this.adalService.getUser().subscribe(
res => {
this.name = res.profile.name.split(' ')[0];
this.bookingService.setUser(res);
},
err => {
console.log(err);
}
);
}
示例2: constructor
constructor(private bookingService: BookingService, private adalService: AdalService) {
this.BookingReady = true;
this.PurchaseReady = false;
this.adalService.getUser().subscribe(
res => {
this.name = res.profile.name;
},
err => {
console.log(err);
}
);
}
示例3: constructor
constructor(private adalService: AdalService, private authService: AuthService) {
//adal service init
this.adalService.init(this.authService.adalConfig);
this.adalService.handleWindowCallback();
this.adalService.getUser();
}
示例4: canActivate
canActivate() {
if (this.adalService.userInfo.isAuthenticated) {
return true;
} else {
this.adalService.login();
return false;
}
}
示例5: login
login() {
this.adalService.login();
}
示例6: logout
logout() {
this.adalService.logOut();
}