Search Posts

Category: ionic3

ionic 3 read stored value native storage in function ionViewDidLoad ()

I’m having a problem, I’d like to read a value saved in the Native Storage Cordova plugin in the function -> ionViewDidLoad (). Description of the function: ionViewDidLoad () = “Runs when the page has loaded. This event only happens once per page being created. If a page leaves but is cached, then this event will not fire again on a subsequent viewing. The ionViewDidLoad event is good place to put your setup code for […]

Common Toast Module for all HTTP calls – Ionic 3

Hi I am unable to understand how to make a common module so for example here am taking an example of only Toast Module. So, within app, I have created a common module – CommonRestProvider which is extending http – get post put etc From my services I am calling this module’s get/post calls in which I want to show a toast after success. It’s constructor looks like this.. constructor(protected http: Http, public loading: LoadingController, […]

compiler.compileModuleAndAllComponentsAsync is taking more time to compile component having (Long Template HTML) and load the component

I am attempting to load a template(HTML) from server dynamically at runtime , render it and bind to Ionic page . i am using a dynamic method to create a component dynamically function createDynamicComponent(html) and passing html to it and keeping html code as template to the dynamic component getdata(url){ let instance=this; this.http.get(url) .subscribe((data:any) => { // debugger; // this.binddata(data._body); console.log(data._body); this.compiler.clearCache() this.compiler.compileModuleAndAllComponentsAsync(createDynamicComponent(data._body)) .then((mwcf: ModuleWithComponentFactories<any>) => { let factory: ComponentFactory<any> = mwcf.componentFactories.find(cf => === […]

Dynamic change color of button for specific button in Angular using Ionic?

<ion-col col-3> <button ion-button (click)=”onPunchPress($event)”><span>1</span></button> </ion-col> <ion-col col-3> <button ion-button (click)=”onPunchPress($event)”><span>2</span></button> </ion-col> How can I change color of specific button? Suppose If I click on 1st button then what to do that only it’s [color] attributre is changed from “light” to “danger” ? Please help urgent need! I have tried som many way, When I use ngClass it changes class for all the buttons. I have to change of clicked one and it should be […]

Markers not loading in Google Maps

I am able to load markers from a local database I include in my Ionic app that is just a simple array of lat/lon coords. The trouble is when I try and load them from a JSON file on the web. Any help would be appreciated. Thanks! this is the call I use: get(‘assets/data/markers.json’) And that all works fine for populating the map from a local data file. Now my issue is that I would […]

Ionic Menu Showing, But Content Does Not Render

I am working on an Ionic 3 app, using PageInterface to show the pages. The menu is rendering on the page once a user logs in, but no content is shown. I’m expecting 2 menu items: Insights, Accounts, Buckets. When I view my code on Ionic lab, it seems like space is held for the meny items, but nothing is there. Below is my code, any help is appreciated. menu.html <ion-header> <ion-navbar> <ion-title>menu</ion-title> </ion-navbar> </ion-header> […]

Push firebase uid to multiple locations – Angularfire2 Ionic 3

I have the following which simply pushes a name into the database along with a uid. I would like to store that uid in another location at the same time. How can I achieve this? Im using ionic 3, angularfire2. addName() { let prompt = this.alertCtrl.create({ title: ‘Name of user’, message: “Enter a name for this new user”, inputs: [ { name: ‘Name’, placeholder: ‘Username’ }, ], buttons: [ { text: ‘Cancel’, handler: data => […]

How to implement Angular4 like dynamic change of components on the screen in ionic3

I am trying to implement a dynamic component change in ionic , the way that angular provides with its routing capabilities for example in angular, i have a parent component A, inside which there is a component B and C , now i wish to change (route) component C to a Component D without changing B and staying in A itself. In ionic I have tried to use the ionic navCtrl but it changes the […]

Next Page »