我有以下代码......
UNION ALL
它有效但现在我需要调用另一个服务来复制我改为
@Injectable()
export class CanActivateIfWork implements CanActivate {
constructor( public myService: MyService ) { }
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
) {
return this.myService.shortPromise().map(message => {
return true;
});
}
}
然而,这似乎不起作用。我也试过了......
@Injectable()
export class CanActivateIfWork implements CanActivate {
constructor( public myService: MyService ) { }
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
) {
return this.myService.shortPromise().map(message => {
return Observable.create(true);
});
}
}
如何将此作为可观察对象返回?