I encountered an issue with my code where a service that was previously working has suddenly stopped functioning and is now displaying an error message stating that it's not a function. Thanks to Sajeetharan for helping me out initially.
constructor(
public navCtrl: NavController,
public navParams: NavParams,
private contactService: ContactsProvider,
private stateService: StatesProvider,
private auth: AuthenticationProvider) {
this.contactId = this.navParams.get('contactId');
}
ngOnInit(){
this.contactService.getContactById(this.contactId)
.subscribe(res => {
this.contact = res.json();
this.contactInitials = this.contact.first_name.charAt(0) + this.contact.last_name.charAt(0);
})
this.states = this.stateService.getStates();
}
The specific error I am encountering is:
: Error: Uncaught (in promise): TypeError: this.stateService.getStates is not a function
This has left me puzzled as to what could potentially be causing this sudden change in functionality.