ionic3

Ionic 3 - Hide status bar during splash screen show

我只是一个虾纸丫 提交于 2019-12-04 04:29:56
问题 I have an app with Ionic 3 and in your app.component.ts, i using the Statusbar ionic plugin to hide that, but, this occurs only after platform ready is fired. How do i hide that during splashscreen? I tried: – Not hide during splashscreen, only after this hide – Not change background color during splashscreen Solutions? 回答1: Android It seems that there is not elegant way to hide statusbar on app launch. But there is an way to do that. Find MainActivity.java (maybe platforms/android/src/io

Error in ionic cordova build android --prod

耗尽温柔 提交于 2019-12-04 04:28:05
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 CHECK FOR MORE DETAIL : https://youtu.be/oCN7iSt8rzg Attached Error Image: Ionic Info: Resolved by

IONIC 3 IOS can't read data from file

谁说胖子不能爱 提交于 2019-12-04 03:51:43
I am using this file picker to upload files to my server: https://github.com/jcesarmobile/FilePicker-Phonegap-iOS-Plugin My server takes base64 files, so I need to convert the file I uploaded. I am doing that using the file plugin mentioned in the ionic docs. So my code looks like this: uploadIOS(){ var self=this let utis = ["public.data"] FilePicker.pickFile( function (uri) { let correctPath = uri.substr(0, uri.lastIndexOf('/') + 1); let currentName = uri.substring(uri.lastIndexOf('/') + 1); self.file.readAsDataURL(correctPath, currentName).then(result=>{ console.log ('reading data ' + JSON

firebase social login not redirected to the app , ionic 3 , ios

邮差的信 提交于 2019-12-04 03:12:39
I am trying to implement social login in my ionic 3 app with the help of 'firebase' authentication. I followed this artical https://javebratt.com/ionic-social-login-firebase/ I installed all the plugins(cordova-plugin-browsertab,cordova-plugin-inappbrowser ..etc) and did exactly same as in the article. Then I ran the app on both android and ios devices. in android device the facebook/google login page is opened in the 'in app browser' and it is redirected to the app successfully after the login process.everything works fine. But in the iPhone the facebook/google login pages are opened in a new

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

安稳与你 提交于 2019-12-04 02:26:32
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 notice, my first array contains 1 object under a user key and my second array contains 3 objects under their

Ionic 2 - Multiple menu at the same time (right - left)

≯℡__Kan透↙ 提交于 2019-12-04 02:21:26
THE SITUATION : I have a working right menu in my Ionic 2 app. I need to add a left menu. I have tried but was unsuccessfull so far. This is my attempt: THE CODE : With this code the right menu is properly working, but it doesn't appear the left menu. app.html: <ion-menu [content]="content" id="menu1"> <ion-header> <ion-toolbar> <ion-title>Pages</ion-title> </ion-toolbar> </ion-header> <ion-content> <ion-list> <button ion-item *ngFor="let p of pages" (click)="openPage(p)"> {{p.title}} </button> </ion-list> </ion-content> </ion-menu> <ion-menu [content]="content" id="menu2"> <ion-header> <ion

Ionic-3 ion-input maxlength attribute not working

走远了吗. 提交于 2019-12-04 02:07:50
I have tried to add ion-input for maxlength , max attribute but it's not working as per expectation. <ion-input type="number" placeholder="*" maxlength="1"></ion-input> <ion-input type="number" placeholder="*" max="1"></ion-input> Anyone knows the solution for the same? Thanks According to this post: maxlength ignored for input type="number" in Chrome Maxlength doesn't work on input type="number" One alternative is suggested here: https://github.com/ionic-team/ionic/issues/7072 where dilhan119 suggests using type="tel" A robust solution is to use a form validator, which will prevent form

Ionic 3: ng-change doesn't work

↘锁芯ラ 提交于 2019-12-04 01:57:53
问题 I have a input field where a user can input his address and get auto-suggestions: <ion-label color="primary" stacked>Adresse:</ion-label> <ion-input type="text" ng-model="autocomplete.query" ng-change="updateSearch()"></ion-input> My class has a update method where i want to do something, but unfortunately he doesn't get into it. updateSearch() { console.log('aaa'); if (this.autocomplete.query == '') { this.autocompleteItems = []; return; } } Any ideas? 回答1: ng-model and ng-change were used

ionic 2 page change event

ぃ、小莉子 提交于 2019-12-03 22:26:25
I want to execute some code every time the page changes. I could add add an ngOnDestroy method to every page. It appears that I could use Ionic 2 page lifecycle hooks (e.g. ionViewDidUnload ) for the exact same effect, but I haven't bothered to test that.I would rather add a single method to the main app class. I see that you can subscribe to Angular 2 Router events . How do I translate that for use in Ionic 2? I'm getting an error with import { Router } from '@angular/router; in the first place: TypeScript error: <path>/node_modules/@angular/router/src/common_router_providers.d.ts(9,55):

ngx-translation issue with ionic 3 app

落爺英雄遲暮 提交于 2019-12-03 20:45:55
ngx translation with ionic 3 app not working for me. below is my code: app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { ErrorHandler, NgModule } from '@angular/core'; import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; import { HttpModule,Http } from '@angular/http'; import { IonicStorageModule } from '@ionic/storage'; import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { MyApp } from './app.component'; import { StatusBar } from '@ionic-native