ionic3

Error in ionic cordova build android --prod

不想你离开。 提交于 2020-01-01 09:16:41
问题 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory Error when running command: ionic cordova build android --prod Note: that ionic build android , ionic run android and ionic serve all works fine. I've read many topics that says once the project gets bigger, it stops working. It was working the day before issue arrive. It stopped working as we added more files and JSON for translation of app in multi-language. Is it a known issue? Is there any solution? PLEASE

How to loop through the data I receive from snapshot.val() and push it to an array based on keys

隐身守侯 提交于 2020-01-01 08:22:10
问题 I want to loop through the data I receive from snapshot.val() based on user keys and push them into an array. I tried doing it with the help of for..in loop like this, firebase.database().ref('\interests').child("I would like to dine with").on('value', (snapshot) => { var data = snapshot.val(); if(snapshot.exists()){ for(let key in data){ console.log("data[key]",data[key]); this.intVal.push(data[key]); console.log("intVal",this.intVal); } } }) But I'm getting something like this, If you

Ionic 2 Print function to POS printer using USB

匆匆过客 提交于 2020-01-01 07:07:42
问题 I need to develop the ionic android app which needs to be integrate with POS printer via USB. I was able to do the same with Bluetooth but when it come to USB connection i am totally zero on this. I hope some one can help me out. I tried with https://ionicframework.com/docs/native/serial/ but no idea how this one gonna work. 来源: https://stackoverflow.com/questions/48395373/ionic-2-print-function-to-pos-printer-using-usb

Ionic 2 Print function to POS printer using USB

我与影子孤独终老i 提交于 2020-01-01 07:07:19
问题 I need to develop the ionic android app which needs to be integrate with POS printer via USB. I was able to do the same with Bluetooth but when it come to USB connection i am totally zero on this. I hope some one can help me out. I tried with https://ionicframework.com/docs/native/serial/ but no idea how this one gonna work. 来源: https://stackoverflow.com/questions/48395373/ionic-2-print-function-to-pos-printer-using-usb

Differences between getRootNav() and navCtrl() methods

喜你入骨 提交于 2020-01-01 05:17:28
问题 Can you tell me what are the differences of below 2 methods? Which moment should I use it? book.ts this.app.getRootNav().push('FromBook', { bookId: this.data.id }) this.navCtrl.push('FromBook', { bookId: this.data.id }); When we use inner components like below sometimes it works.Sometimes it is not.Why this kind of different behavior with above 2 navigation methods? author-page.html <div> <book *ngFor="let book of authorData?.books" [data]="book"></book> </div> 回答1: Both methods add a new

Ionic 3 : Close modal with phone's back button

谁说我不能喝 提交于 2020-01-01 05:15:08
问题 I try to override the phone's back button in my Ionic App. This code permit me to open a modal to close the App if I'm not in a page, else close the page. But this doesn't allow me to close an opened modal. How can I detect if I'm in a modal to close it ? platform.registerBackButtonAction(() => { let nav = app.getActiveNav(); let activeView: ViewController = nav.getActive(); console.log(activeView); if(activeView != null){ if(nav.canGoBack()) { activeView.dismiss(); } else{ let alert = this

how to do horizontal scroll in ionic 3

我只是一个虾纸丫 提交于 2019-12-31 16:11:14
问题 look at my I have 10 names in the ion-scroll but it is coming to the next line like a paragraph. here is my .html code. <ion-scroll scrollX="true" style="width:100vw; height:50px" > <ion-row class="headerChip"> <div *ngFor="let tabName of product_type; let idx = index" [ngClass]="showSelectedTabArray[idx].showSelectedTab ? 'headerChipGray' : 'headerChipGreen'"> <ion-chip (click)="changeData(tabName)"> <ion-label >{{tabName.languagename}}</ion-label> <div></div> </ion-chip> </div> </ion-row> <

IONIC 3: Plugin BackgroundMode dont work: Object(…) is not a function

给你一囗甜甜゛ 提交于 2019-12-31 05:09:16
问题 I need to run the code “this.backgroundMode.enable()” in my project, but it shows me the following error: "Object(...) is not a function" It imports it in app.module.ts in the following way: import {BackgroundMode} from '@ ionic-native / background-mode / ngx'; ... providers: [ ... BackgroundMode ...] And in the page (in my case is in app.component.ts, after deviceready, like the official documentation says) i use like: import {BackgroundMode} from '@ ionic-native / background-mode / ngx';

Angular2 EXCEPTION No provider for String

不想你离开。 提交于 2019-12-30 17:45:13
问题 I've got a brand new app create with a ng-cli with this very simple code ^^ import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { constructor(private my: string) {} } and I've got in the console EXCEPTION: No provider for String! I don't see any error in the code so what's wrong ! In ng-book I can read export class Article { title: string; link: string; votes: number;

Ionic 3 Login Authentication Using API - Cannot read property 'json' of null

≡放荡痞女 提交于 2019-12-30 17:26:13
问题 I am doing authentication in Ionic 3 using API but In the login process, it is showing error: Cannot read property 'json' of null This is my providers>restapi>restapi.ts import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; import {Http, Headers} from '@angular/http'; let apiUrl = 'http://192.168.1.10/honeybee/HoneyApi/'; @Injectable() export class RestapiProvider { constructor(public http: HttpClient) { console.log('Hello RestapiProvider Provider'); }