Posts

Showing posts from July, 2018

IONIC

Routing in ionic application Whenever we create a page we have to register the pages in app.module.ts @NgModule({   declarations: [     MyApp,     HomePage,     ShopPage,     BuyoutPage   ],   imports: [     IonicModule.forRoot(MyApp)   ],   bootstrap: [IonicApp],   entryComponents: [     MyApp,     HomePage,     ShopPage,     BuyoutPage   ],   providers: [{provide: ErrorHandler, useClass: IonicErrorHandler}] }) <button ion-button (click)="onGoToShop()">Go to Shop</button> export class HomePage {   constructor(public navCtrl: NavController ) {   }   onGoToShop() {    this.navCtrl.push(ShopPage); }        } How to I pass data from one page to another ?? ·      ...

Routing

Image
How do I access the query param ? If the component loads for the first time, we can access via snapshot à code inside the red rectangle. If there is another route within the component then fetching of query params would fail. Hence use the params approach and subscribe to any new routing trigger à code inside yellow rectangle. How do i inform angular that the query param for eg:- id is not a atsring rathere it is a number???