Javascript read.ts(6133)模块'&//节点“模块/rxjs/observable/CombineTest”';没有导出的成员';组合测试&x27;。ts(2305)

Javascript read.ts(6133)模块'&//节点“模块/rxjs/observable/CombineTest”';没有导出的成员';组合测试&x27;。ts(2305),javascript,html,angular,rxjs,Javascript,Html,Angular,Rxjs,如何通过CombineTest组合观测值。未定义CombineTest 我使用的是angular js 7。我想对tow查询字符串参数加上marge,但当我编写obserable.combinerate([])时,它会给出en错误 import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Observable, of, observab

如何通过CombineTest组合观测值。未定义CombineTest

我使用的是angular js 7。我想对tow查询字符串参数加上marge,但当我编写obserable.combinerate([])时,它会给出en错误

import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Observable, of, observable } from 'rxjs'
import { combineLatest } from 'rxjs/observable/combineLatest';
@Component({
  selector: 'app-githubfollowers',
  templateUrl: './githubfollowers.component.html',
  styleUrls: ['./githubfollowers.component.css']
})
export class GithubfollowersComponent implements OnInit {

  constructor(private rout:ActivatedRoute ) { }

  ngOnInit() {
    Observable.combineLatest([  this.rout.paramMap,
  this.rout.queryParamMap

    ]);

    this.rout.paramMap.subscribe(prams=>{

    });
    this.rout.queryParamMap.subscribe(prams=>{

    });
  }

}

你错了。您使用了RXJSV5的导入

对于RxJS v6+,您应该使用以下导入:

import { combineLatest } from 'rxjs';
要解决以下错误消息,请执行以下操作:

ngOnInit(){Observable.CombineTest([this.rout.paramMap, 上不存在this.rout.queryParamMap]);属性“CombineRelatest” “类型”可观察的类型

您可以这样使用
CombineTest

combineLatest(this.rout.paramMap, this.rout.queryParamMap)

您可能需要花一些时间来阅读如何使用它:

当我添加这个时,显示ngOnInit(){Observable.combineLatest([this.rout.paramMap,this.rout.queryParamMap]);属性“combineLatest”在类型“typeof Observable”上不存在我也在使用角度js7