首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >类型记录错误:模块‘./node_ Module /rxjs/Rx“’没有导出成员'SubscriptionLike‘

类型记录错误:模块‘./node_ Module /rxjs/Rx“’没有导出成员'SubscriptionLike‘
EN

Stack Overflow用户
提问于 2018-06-04 10:14:03
回答 1查看 3.4K关注 0票数 1

基本上,我试图构建一个应用程序,将http请求发送到服务器,并在app.i上显示数据。i遵循这个教程,.i在安装了所有模块之后显示了there.but。我对ionic.So知之甚少,给我一个文章和描述性的解决方案。

packages.json

代码语言:javascript
复制
 {
  "name": "CompassApp",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@agm/core": "^1.0.0-beta.3",
    "@angular/animations": "5.2.10",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/compiler-cli": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@ionic-native/barcode-scanner": "^4.7.0",
    "@ionic-native/core": "4.7.0",
    "@ionic-native/http": "^4.7.0",
    "@ionic-native/splash-screen": "4.7.0",
    "@ionic-native/status-bar": "4.7.0",
    "@ionic/pro": "1.0.20",
    "@ionic/storage": "2.1.3",
    "angularfire2": "^5.0.0-rc.10",
    "cordova-plugin-advanced-http": "^1.11.1",
    "firebase": "^5.0.4",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "phonegap-plugin-barcodescanner": "^8.0.0",
    "rxjs": "^5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.9",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "phonegap-plugin-barcodescanner": {},
      "cordova-plugin-advanced-http": {}
    }
  }
}

Rect.ts

代码语言:javascript
复制
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';

/*
  Generated class for the RestProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class RestProvider {

  apiUrl = 'https://jsonplaceholder.typicode.com';

  constructor(public http: HttpClient) {
    console.log('Hello RestProvider Provider');
  }

  getUsers() {
    return new Promise(resolve => {
      this.http.get(this.apiUrl+'/users').subscribe(data => {
        resolve(data);
      }, err => {
        console.log(err);
      });
    });
  }
}
EN

回答 1

Stack Overflow用户

发布于 2018-06-04 10:18:14

角6不适用于RxJS 5.5,而适用于RxJS 6。

您的package.json应该包含"rxjs": "^6.1.0"

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50678213

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档