3

我尝试在我的应用程序中设置 ionic Cloud,但出现此错误: Uncaught TypeError: angular.element is not a function(...) for this line:

 CloudModule.forRoot(cloudSettings)

我的代码:对于 app.module.ts

import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { CloudSettings, CloudModule } from '@ionic/cloud-angular';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import {DetailsPage} from '../pages/details/details';
import {OtherPage} from '../pages/other-page/other-page';
import { Page1 } from '../pages/page1/page1';
import { Page2 } from '../pages/page2/page2';

var cloudSettings: CloudSettings = {
'core': {
'app_id': 'xxxxx'
}
};

console.log(cloudSettings);

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

感谢您,

4

0 回答 0