ionic-framework

Write multiple row at a time

偶尔善良 提交于 2019-12-24 21:43:31
问题 I am using ionic v1 and angularjs and add value into database by using foreach loop but its getting slow to me(500 times execute this loop). Factory 1: self.query = function(query, parameters) { return $cordovaSQLite.execute(db, query, parameters).then(function(result) { //console.log(result); return result; }, function (error) { console.log(error); return error; }); }; Factory 2: self.add = function (url,data) { return DBA.query("INSERT OR REPLACE INTO offline_data (id, data) VALUES (?, ?)",

Display google login data in other page ionic

拥有回忆 提交于 2019-12-24 21:19:11
问题 i'm trying to add google login to my apps, i use firebase. Login button and function is on welcome page like this. logic.service.ts login(){ this.googlePlus.login({ 'webClientId' : 'webapi.apps.googleusercontent.com', 'offile' : true }).then(res=>{ firebase.auth().signInWithCredential(firebase.auth.GoogleAuthProvider.credential(res.idToken)) .then(suc=>{ this.router.navigate(["/tabs/home"]); this.user = res; this.getData(); console.log(this.user); }).catch(ns=>{ alert('Unsucessful'); }) }) }

How to change variable from another page Ionic4

风格不统一 提交于 2019-12-24 20:57:09
问题 I'm creating a simple tabs-based app in Ionic4, and I want to change a variable in the main tabs page, where tabs switcher is shown, from the first tab, and I want to change this variable, when the scrolling position is on the right level on the first tab ionic content. The question is, how to change variable in tabs.page.ts from tab1.page.ts. I have info about the current day in html of tabs page, and it should change according to scroll position. tabs.page.ts file (I want to change current

Trouble to upload images with FileTransfer

拜拜、爱过 提交于 2019-12-24 20:36:30
问题 I’m trying to add a function to my application which allow the user to take a picture with his camera or from his smartphone to upload it as a profil picture. I’ve picked this function from another project which is working great but isn’t from me but one of my colleague (he left). I don’t know why since I’ve used the exact same function but the image uploaded look like this : the corrupt image It will randomly start to corrupt the file, generally in the first quarter. One time, it worked but

Inject Custom Component in ionic 3 page

大兔子大兔子 提交于 2019-12-24 20:32:55
问题 I just created a loading component in ionic so that i can inject it in any page as loading while getting data from server (HTTP req/res). I somehow managed to import it in app.module.ts file (since its my first time). Now i am not able to inject it in my template Following is my custom component ts file @Component({ selector: 'loader', templateUrl: 'loader.html' }) export class LoaderComponent { text: string; splash: boolean; constructor() { this.splash = false; } show(){ this.splash = true;

ios ui is different then android and browser ionic

谁说我不能喝 提交于 2019-12-24 20:30:41
问题 We have built an ionic application for IOS and Android, but their ui is different: In android and browser design is perfect but in IOS the design changes and it's not good for me. For example, I have some headers with different colors, few buttons have corner radius, etc... but I'm using simple buttons. How can I force the style to be the same for every platform? Here's my config file: <?xml version='1.0' encoding='utf-8'?> <widget id="xx" version="0.0.2" xmlns="http://www.w3.org/ns/widgets"

Ionic Facebook Authentication Redirection Problem

瘦欲@ 提交于 2019-12-24 20:26:21
问题 I followed this tutorial step by step https://ionicthemes.com/tutorials/about/ionic-facebook-login The issue I’m having is that after the login, my app is not redirecting to the page I need it to. No error on the console when testing this on an emulated Pixel 2 device running Android 9 . Here’s the code for handling the authentication: const permissions = ['public_profile', 'email']; await this.facebook.login(permissions).then(response => { this.uid = response.authResponse.userID; this

ionic android : when choose image from gallery the app crash

大城市里の小女人 提交于 2019-12-24 20:21:44
问题 When I click on choose file(input="file") to choose an image from gallery , after select the image on android the app crash , and also on ios (iphone). I already add the permissions on the androidmanifest.xml: <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.FLASHLIGHT" /> <uses-feature android:name="android.hardware.camera" android:required="true" /> <uses-feature android:name="android.hardware.camera.autofocus" /> and still not

ionic iOS FCM works in development mode but does not work in production

若如初见. 提交于 2019-12-24 19:28:51
问题 I'm using: Xcode10 Legacy build Phonegap-plugin-push 1.10.5 I followed https://github.com/aggarwalankush/push-notification-server (notification server) and https://github.com/aggarwalankush/ionic-push-base (ionic app) I have set up FCM using https://medium.com/@ankushaggarwal/gcm-setup-for-android-push-notifications-656cfdd8adbd. I have also set up the .p12 certificate for both production and development and have targeted the production certificate in my notification server. Once my app was

How to calculate multiplication of numbers in a html table below specific headings - IONIC

限于喜欢 提交于 2019-12-24 19:28:41
问题 Explanation: I have a html table with 3 columns namely Price , Quantity and Total . Numers are written below them. Requirement: I need to multiply price with Quantity and bring that value in Total . I want to do this while leaving the quantity field or on a key press [as i am typing]. Image and code of my form are shared below Image: code of invoice.html <div style="margin-top:15px"> <table> <tr> <th></th> <th>Price</th> <th>Quantity</th> <th>Total</th> <th></th> </tr> <tr *ngFor="let items