在App模块的提供程序内部添加文件和FilePath会在Ionic 3中引发错误

时间:2019-03-07 09:46:27

标签: ionic-framework ionic3

安装所有必需的依赖项并将其导入App Module后,它会引发文件和文件路径错误。就像它不能包含在提供程序中一样。

    import { Camera } from '@ionic-native/camera';
    import { MyApp } from './app.component';
    import { File } from '@ionic-native/file';
    import { Transfer } from '@ionic-native/transfer';
    import { FilePath } from '@ionic-native/file-path';

@NgModule({
  declarations: [MyApp],
  imports: [
    BrowserModule,
    FormsModule,
    ReactiveFormsModule,
    HttpClientModule,
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot(),
    EmojiPickerModule.forRoot()
  ],
  bootstrap: [IonicApp],
  entryComponents: [MyApp],
  providers: [
    {
      provide: HTTP_INTERCEPTORS,
      useClass: TokenInterceptor,
      multi: true
    },
    StatusBar,
    SplashScreen,
    { provide: ErrorHandler, useClass: IonicErrorHandler },
    AuthProvider,
    TokenProvider,
    MessageProvider,
    File,
    Transfer,
    Camera,
    FilePath,  
    PostProvider,
    UsersProvider,

  ]
})
export class AppModule {}

为什么不允许在providers部分中实现这两个?如何解决?我们正在使用Ionic 3

0 个答案:

没有答案