Im Create new Ionic page name for listing and i m added some file its name listing.service.ts after I cant open this listing page i had some error
Error: Uncaught (in promise): Error: No provider for ListingService!
Error: No provider for ListingService!
Im try to fix it for more than one hour but cant found any solutions , how to fix it ? Thanks This is my code
listing.module.ts
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { ListingPage } from './listing';
import {ListingService} from "./listing.service";
@NgModule({
declarations: [
ListingPage,
],
imports: [
IonicPageModule.forChild(ListingPage),
],
providers: [
ListingService
]
})
export class ListingPageModule {}
listing.service.ts
import {Injectable} from '@angular/core';
@Injectable()
export class ListingService {
private eventMap:any;
constructor() {
this.initEventMap();
}
app.module.ts
import {ListingService} from "../pages/listing/listing.service";
const providers = [ ListingService ];
@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),
CalendarModule, // Ionic Calendar
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}