类型“OperatorFunction<未知,[未知,布尔值,任意]>”上不存在属性“管道”

Mig*_*ura 2 observable rxjs angular angular9

使用 Angular 9,我需要根据返回两个可观察值的两种方法检查条件:

    return zip(this.authService.isSignedIn(), this.authService.getRole()).pipe(
      map(([isSignedIn, role]: [boolean, string]) => isSignedIn && role && role.toLowerCase() === 'admin')
    );
Run Code Online (Sandbox Code Playgroud)

但我收到错误:

 Property 'pipe' does not exist on type 'OperatorFunction<unknown, [unknown, boolean, any]>
Run Code Online (Sandbox Code Playgroud)

我缺少什么?

oni*_*nik 5

这是常见的错误,您误用了导入,请确保您是zip从而rxjs不是从另一个命名空间导入

Import {zip} from "rxjs"
Run Code Online (Sandbox Code Playgroud)