Hi,
I have made a service to share data between components. However they don’t share the same service.
I tried to include it in the ng-module, but I got this “weird” error:
"Unhandled Promise rejection: Component OrderingService is not part of any NgModule or the module has not been imported into your module. ; Zone: <root> ; Task: Promise.then ; Value: Error: Component OrderingService is not part of any NgModule or the module has not been imported into your module."
YES IT IS!
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { MenuPage } from '../pages/menu/menu';
import { OrderingPage } from '../pages/ordering/ordering'
import { ServingPage } from '../pages/serving/serving'
import {ProductItem} from '../pages/product/product'
import {Shoppingkart} from "../pages/shoppingkart/shoppingkart"
import { OrderingService } from '../providers/orderingservice'
import { ServingService } from '../providers/servingservice'
import { AngularFireModule } from 'angularfire2'
export const firebaseConfig = {
apiKey: "AIzaSyAiDYQ7ys",
authDomain: "booka$",
databaseURL: "httpio.com",
storageBucket: "bookm",
messagingSenderId: "8969817"
};
@NgModule({
declarations: [
MyApp,
HomePage,
OrderingPage,
ServingPage,
ProductItem,
Shoppingkart,
],
imports: [
IonicModule.forRoot(MyApp),
AngularFireModule.initializeApp(firebaseConfig)
],
bootstrap: [IonicApp,OrderingService],
entryComponents: [
MyApp,
HomePage,
OrderingPage,
],
providers: [{ provide: ErrorHandler, useClass: IonicErrorHandler },OrderingService]
})
export class AppModule { }
Any Help?