Search Posts

Category: ionic2

Need help in Google Analytics tool on a Windows 10 app that uses Ionic 2

I am using Ionic 2 with Angular 2 as my base. Can anyone suggest me a good analytics tool that can be used that can work for all 3 mobile platforms i.e. Windows, iOS, & Android. I did check Google Analytics but for some reason it did not work well with Windows 10 app. Is there any other tool that can help me on this. In case you think Google Analytics is the tool to […]

Location coordinates blank in service.nearbySearch in ionic2 using google-geolocation

I am trying to use google maps in my application.I want to show nearby places in map. I have done it using this link https://www.joshmorony.com/create-a-nearby-places-list-with-google-maps-in-ionic-2-part-1/ https://www.joshmorony.com/create-a-nearby-places-list-with-google-maps-in-ionic-2-part-2/ in this link location.json file is used and location coordinates passed to marker. what i want to do is i want to take the location coordinates in run time and put marker in map.I am getting the list of places but location coordinated are blank. below is my code […]

Display JSON data with Ionic 2/AngluarJS?

I’m fetching API data using AngularJS/Ionic 2. I’ve followed this guide and get it to properly log the data when I go to home.html. But when I try to actually display the data in home.html I can’t get it to work. data-provider.ts: getRemoteData(){ this.http.get(‘https://api.example.com/?limit=10’).map(res => res.json()).subscribe(data => { console.log(data); }); } home-ts: ionViewDidLoad(){ this.dataService.getRemoteData(); } This correctly logs JSON data: [ { “id”: “a”, “name”: “ExampleA”, “price”: “10” }, { “id”: “b”, “name”: “ExampleB”, “price”: […]

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 […]

ngClass does not update DOM in Promise Callback

I have a Rating Component (Angular) as follows: import { Component, ChangeDetectionStrategy, Input, NgZone, ApplicationRef} from ‘@angular/core’; import { Icon } from ‘ionic-angular/components/icon/icon’; import { Events } from ‘ionic-angular’; // import { ImageService } from ‘../../providers/image-service/image-service’; // @Component({ selector: ‘rating’, providers: [Icon], templateUrl: ‘rating.html’, changeDetection: ChangeDetectionStrategy.OnPush }) export class RatingComponent { static readonly RATING_CHANGE: string = ‘ratings-changed’; text: string; private tempscore: number = 0; // @Input() public score: number = 0; @Input() public max: number […]

ionic 2 search filter keep reloading page

I’m working on an ionic 2 app where i need to apply a filter on a particular page. from my script what happens is, when i start typing it and starts filtering the page keeps on reloading back to its former state. getroutes() { this.http.post(‘http://localhost/app/get_products.php’,{‘trans_type’:this.user_type_send}).map(res => res.json()).subscribe(data =>{ console.log(JSON.stringify(data)); this.items= data; }) } ngOnInit() { let loader = this.LoadingController.create({ content: ‘Please Wait’ }); loader.present().then(()=>{ this.getroutes(); loader.dismiss(); }) } filterItems(ev: any) { this.getroutes(); let val = […]

How to make multiple request in a loop in agularjs2 in Ionic?

I have to copy an online database to offline database using an API call with post method. one API call returns 12 records and number of total records are unknown. To do that I wrote the following code and when I ran it, it never stopped. function should stop when the result is empty. but its not stopping, I think it is the issue with asynchronous nature of JavaScript. Anyone who can suggest a solution. […]

When i am testing the application i am getting this error No component factory found for AlertModal

Code: this.modalRef = this.alertService.open(AlertModal,this.logoutScreenOptions); this.modalRef.componentInstance.messageObj = {type : ‘basic’, title: title, message: msg}; this.modalRef.result.then((result) => { }, (reason) => { console.log(“Closed with “+reason); }); @NgModule({ entryComponents: [ AlertModal ] }) Error: Error: No component factory found for AlertModal. Did you add it to @NgModule.entryComponents? at noComponentFactoryError (http://localhost:9876/base/src/test.ts?255649f9a1a6edbb610949c0145114536ad2d17e:3704:34) at _NullComponentFactoryResolver.Array.concat._NullComponentFactoryResolver.resolveComponentFactory (http://localhost:9876/base/src/test.ts?255649f9a1a6edbb610949c0145114536ad2d17e:3722:15) Source: AngularJS

How to solve the CORS issue when the endpoint doesn’t accept OPTIONS method?

I’m building mobile client apps for easily manage Magento E-commerce store, I;m using the Token Based authentication here , I’m using ionic2 for my mobile framework. My problem is, The angular HTTP is sent OPTIONS request instead of POST to /V1/integration/admin/token endpoint that produce 400 bad request because the endpoint doesn’t support the OPTIONS method. here my code : import { Injectable } from ‘@angular/core’; import { Http, Headers, RequestOptions } from ‘@angular/http’; import ‘rxjs/add/operator/map’; […]

ionic2 Angular2 import/export JSON data

What I mean by import/export data and why it needs to be implemented.. 1) I want my app to work offline – store data added by user while offline. 2) The data stored in JSON format. 3) I want that JSON data to export in a file and stored in phone memory. 4) Multiple files will be created. 5) When user get internet – the exported file will be imported and that JSON object to […]

Next Page »