离子3中没有CallNumber的提供者 [英] No provider for CallNumber in ionic 3
本文介绍了离子3中没有CallNumber的提供者的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用离子3,我想拨打一个号码,为此我已经为电话号码添加了离子原生插件:
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
但它抛出一个错误:
错误:未捕获(承诺):错误:没有CallNumber的提供者!
ERROR Error: Uncaught (in promise): Error: No provider for CallNumber!
推荐答案
您还需要添加 CallNumber
提供商
AppModule
的数组(位于 app.module.ts中)
file):
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 {}
这篇关于离子3中没有CallNumber的提供者的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文