I am using ionic 3, I want to call a number and for that I have added ionic native plugin for call-number:
ionic cordova plugin add call-number
npm install --save @ionic-native/call-number
But it's throwing an error:
ERROR Error: Uncaught (in promise): Error: No provider for CallNumber!
You also need to add CallNumber
in the providers
array of your AppModule
(located in the app.module.ts
file):
// ...
import { CallNumber } from '@ionic-native/call-number';
@NgModule({
declarations: [..],
imports: [...],
bootstrap: [IonicApp],
entryComponents: [...],
providers: [
CallNumber, // <--- Here! :)
...
...
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}
Add as a provider inside app.module.ts
providers: [
CallNumber,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With