I have two components both using the same Service I created
#Component A
@Component({
templateUrl: 'build/pages/templateReunionCourse/templateReunionCourse.html',
providers: [
ReunionService,JSONP_PROVIDERS
]
})
export class Reunion{
month: any;
constructor(private loadingController: LoadingController,private navCtrl: NavController, public reunionService: ReunionService, public cmpB: ComponentB)
{
this.month = new Date().toDateString();
}
onClickItem(string: any){
this.cmpB.data=string;
this.navCtrl.setRoot(Courses);
}
}
#ComponnetB @Component({ templateUrl: 'build/pages/courses/courses.html', providers: [ReunionService] }) export class Courses { Date: any; data: any; constructor(private loadingController: LoadingController, private navCtrl: NavController, public courseService: ReunionService) { this.Date = new Date().toDateString(); this.presentLoading(); this.loadRaces();
}
}
When I attempt to Run. I get the error No provider for Component A
Any insight or alternative approach would b appreciated. My goal is to set data in component B from Component A so that when I push component B to Front I can view that data