Reputation: 73
I am attempting to use the ionic native file plugin, but am receiving an error when attempting to run the app after installation
Partial app.module.ts file:
...
import { File } from '@ionic-native/file';
...
@NgModule({
declarations: [AppComponent],
entryComponents: [],
imports: [
...
],
providers: [
...
File
],
bootstrap: [AppComponent]
})
export class AppModule {}
Error in console is
Uncaught TypeError: Object(...) is not a function
Upvotes: 0
Views: 2265
Reputation: 2519
install
ionic cordova plugin add cordova-plugin-file
npm install @ionic-native/file --save
import app.module.ts
like this
import { File } from "@ionic-native/file/ngx";
providers: [
File
]
Upvotes: 1