Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49358

Null Injector Error when calling a method of my custom service

$
0
0

There is a page I’m using my own service. Then in the console, I’m getting the below error.

async subscribeMembership( id ){
  let loader = await this.loadingCtrl.create({
    spinner: null,
    message: `<div class="loader"></div><div class="loader_msg">Processing</div>`,
  });
  await loader.present();
    var response = await this.IapProvider.subscribeMembership( id, this.user_id);
    if(response['error'] == false){
      this.showAlert('Info',response['errorMsg']);
      loader.dismiss();
    } else if(response['error'] == true) {
      this.showAlert('Failed', response['errorMsg']);
      loader.dismiss();
    }else {
      this.showAlert('Failed', 'Unknown failure');
      loader.dismiss();
    }
  }
}

IapProvider is my custom class.

ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)[[object Object] → [object Object] → [object Object]]:
NullInjectorError: No provider for [object Object]!
NullInjectorError: R3InjectorError(AppModule)[[object Object] → [object Object] → [object Object]]:
NullInjectorError: No provider for [object Object]!

Are there any proper steps that I need to follow?

2 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 49358

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>