我在使用CanActivate方法时遇到了一个问题: error ts2366 "Function does return statement and return type not include下面是我的代码: import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot, UrlTree } from '@this.authService.isAuth) {
return true;
我使用的是Angular 7,现在有一个方法(Angular guard CanActivate)包含了一些嵌套的http调用方法,我需要在所有嵌套的http调用完成后返回数据。如下面的代码所示,只有在getCurrentUser()完成后,才在canActivate()中返回result,而现在,它总是返回false,因为getCurrentUser()还没有完成。export class AuthGuard im