【问题标题】:Ionic Native HTTP client (@ionic-native/http) not working when importingIonic Native HTTP 客户端(@ionic-native/http)在导入时不工作
【发布时间】:2019-06-18 07:46:21
【问题描述】:

当我按照文档的描述导入 HTTP 客户端时,出现以下错误:

Uncaught (in promise): Error: Can't resolve all parameters for AmtsPage: (?)

这是我的代码:

import {Component, OnInit} from '@angular/core';
import {HTTP} from '@ionic-native/http';

@Component({
  selector: 'app-amts',
  templateUrl: './amts.page.html',
  styleUrls: ['./amts.page.scss'],
})
export class AmtsPage implements OnInit {


  constructor(private http: HTTP) {}

  ngOnInit() {
  }
}

我已经安装了正确的 ionic-native npm 包,如此处所述https://ionicframework.com/docs/native/http/

【问题讨论】:

    标签: typescript ionic-framework ionic-native ionic4


    【解决方案1】:

    您正在查看 v3 文档。
    在此处查看 Ionic 4 文档:

    https://beta.ionicframework.com/docs/native/http

    Ionic 4 使用稍微不同的导入路径:

    import { HTTP } from '@ionic-native/http/ngx';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-01
      • 2018-08-27
      • 2021-11-03
      • 2018-02-19
      • 1970-01-01
      相关资源
      最近更新 更多