情况

我设置了一个空白应用程序。已安装@ionic/cloud-angular并导入了provideCloud

但是我收到以下错误:

cloud-angular has no exported member 'provideCloud'


node.js - cloud-angular没有导出成员provideCloud-LMLPHP

(我对ionicBootstrap有类似的错误)

步骤:


离子启动whateva空白--v2
npm install @ ionic / cloud-angular-保存
离子启动
导入provideCloud


代码:

import { provideCloud, CloudSettings } from '@ionic/cloud-angular';
import { ionicBootstrap, Platform } from 'ionic-angular';


离子信息:

Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.2
Ionic CLI Version: 2.1.8
Ionic App Lib Version: 2.1.4
Ionic App Scripts Version: 0.0.44
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: OS X El Capitan
Node Version: v4.6.0
Xcode version: Xcode 7.3.1 Build version 7D1014


Package.json依赖项:

"dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/cloud-angular": "^0.7.0",
    "@ionic/storage": "1.1.6",
    "ionic-angular": "2.0.0-rc.2",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.21"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.44",
    "typescript": "2.0.6"
  },


问题:

为什么我得到错误?

我刚刚设置了一个新的空白应用程序。设置中有问题吗?

谢谢!

最佳答案

在发布版本0.7.0时,如您在code中看到的,provideCloudCloudModule替换。

设置云设置的新方法如下

import { CloudSettings, CloudModule } from '@ionic/cloud-angular';

const cloudSettings: CloudSettings = {
  'core': {
    'app_id': 'APP_ID'
  }
};

@NgModule({
  declarations: [ ... ],
  imports: [
    IonicModule.forRoot(MyApp),
    CloudModule.forRoot(cloudSettings)
  ],
  bootstrap: [IonicApp],
  entryComponents: [ ... ],
  providers: [ ... ]
})
export class AppModule {}

关于node.js - cloud-angular没有导出成员provideCloud,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40633852/

10-16 06:18