ERROR Error: Uncaught (in promise): Error: StaticInjectorError

질문:
ERROR Error: Uncaught (in promise): Error: StaticInjectorError[CallNumber]: 
  StaticInjectorError[CallNumber]:      NullInjectorError: No provider for CallNumber! Error: StaticInjectorError[CallNumber]:    StaticInjectorError[CallNumber]:      NullInjectorError: No provider for CallNumber!     at _NullInjector.get (vendor.js:1276)     at resolveToken (vendor.js:1564)     at tryResolveToken (vendor.js:1506)     at StaticInjector.get (vendor.js:1377)     at resolveToken (vendor.js:1564)     at tryResolveToken (vendor.js:1506)     at StaticInjector.get (vendor.js:1377)     at resolveNgModuleDep (vendor.js:10937)     at NgModuleRef_.get (vendor.js:12158)     at resolveDep (vendor.js:12654)     at _NullInjector.get (vendor.js:1276)     at resolveToken (vendor.js:1564)     at tryResolveToken (vendor.js:1506)     at StaticInjector.get (vendor.js:1377)     at resolveToken (vendor.js:1564)     at tryResolveToken (vendor.js:1506)     at StaticInjector.get (vendor.js:1377)     at resolveNgModuleDep (vendor.js:10937)     at NgModuleRef_.get (vendor.js:12158)     at resolveDep (vendor.js:12654)     at c (polyfills.js:3)     at Object.reject (polyfills.js:3)     at NavControllerBase._fireError (vendor.js:48455)     at NavControllerBase._failed (vendor.js:48448)     at vendor.js:48495     at t.invoke (polyfills.js:3)     at Object.onInvoke (vendor.js:4979)     at t.invoke (polyfills.js:3)     at r.run (polyfills.js:3)
    at polyfills.js:3
해결 방법:
1. 앱에서module.ts 파일 맨 위에 [import {CallNumber} from "@ionic-native/call-number"추가;]
2.providers 추가 [CallNumber,]
 
import { CallNumber } from "@ionic-native/call-number";

...

@NgModule({
    ...

    providers: [
    ...
    CallNumber,
    ...
	]
	...
})
export class AppModule { }

 
 

좋은 웹페이지 즐겨찾기