ionic3

Unable to run ionic3 application

微笑、不失礼 提交于 2020-01-23 20:24:59
问题 I have an ionic3 application and I installed ionic with npm install -g ionic cordova , but when I run the application with ionic serve , i get this error : typescript error [app-scripts] Unknown compiler option 'resolveJsonModule'. [app-scripts] Unknown compiler option 'esModuleInterop'. [app-scripts] [11:58:10] typescript error [app-scripts] [11:58:10] ionic-app-script task: "serve" [app-scripts] [11:58:10] TypeError: Cannot read property 'replace' of null [app-scripts] TypeError: Cannot

To disable bouncing effect in ios scroll ionic 3

£可爱£侵袭症+ 提交于 2020-01-23 04:41:07
问题 I tried some methods to disable bounce effect set no-bounce attribute to ion-content <ion-content no-bounce></ion-content> And added styles to ion-content to disable bounce. Still no fix to my problem. 回答1: It works on Ionic 4 with this. (Sorry, I don't have an explanation). <ion-content no-bounce has-bouncing="false" forceOverscroll="false"> 回答2: For ionic 4 <ion-content forceOverscroll="false"> Just using forceOverscroll="false" worked for me, the docs say do the opposite 回答3: I solved my

Cannot determine the module for class X in X.ts! Add X to the NgModule to fix it error in ionic2

天大地大妈咪最大 提交于 2020-01-20 05:49:51
问题 I am facing an issue when I try to build my app using the following command : ionic cordova run android --prod --release Everything runs fine if I run the command as below: ionic cordova run android The error Iam getting is : Error: Cannot determine the module for class CartItemsPage in C:/test/src/pages/cart/cart-items.ts! Add CartItemsPage to the NgModule to fix it. Cannot determine the module for class ItemsPage in C:/test/src/pages/items/items.ts! Add ItemsPage to th e NgModule to fix it.

Cannot determine the module for class X in X.ts! Add X to the NgModule to fix it error in ionic2

旧街凉风 提交于 2020-01-20 05:49:49
问题 I am facing an issue when I try to build my app using the following command : ionic cordova run android --prod --release Everything runs fine if I run the command as below: ionic cordova run android The error Iam getting is : Error: Cannot determine the module for class CartItemsPage in C:/test/src/pages/cart/cart-items.ts! Add CartItemsPage to the NgModule to fix it. Cannot determine the module for class ItemsPage in C:/test/src/pages/items/items.ts! Add ItemsPage to th e NgModule to fix it.

Ionic: Showing an alert controller with a checkbox and text input

夙愿已清 提交于 2020-01-20 05:10:25
问题 I am trying to show a checkbox along with a text input field. (Ionic 3.5.3) The checkbox is not showing up. I looked at another SO thread for a similar question. The code seems to be the same as what I am doing. The code: let alert = this.alert.create({ title: 'Name your trip', inputs: [ { name: 'name', placeholder: 'Your trip name', }, { name: 'gpsxy', type:'checkbox', checked:true, label:'Log GPS co-ords', value:"true" } ], buttons: [{ text: 'Cancel', role: 'cancel', handler: data => { } },

Ionic: Showing an alert controller with a checkbox and text input

孤者浪人 提交于 2020-01-20 05:09:09
问题 I am trying to show a checkbox along with a text input field. (Ionic 3.5.3) The checkbox is not showing up. I looked at another SO thread for a similar question. The code seems to be the same as what I am doing. The code: let alert = this.alert.create({ title: 'Name your trip', inputs: [ { name: 'name', placeholder: 'Your trip name', }, { name: 'gpsxy', type:'checkbox', checked:true, label:'Log GPS co-ords', value:"true" } ], buttons: [{ text: 'Cancel', role: 'cancel', handler: data => { } },

Switch icon in ionic2 after click

夙愿已清 提交于 2020-01-17 03:05:10
问题 I have list of item, each of items has button with ion-icon <ion-list> <ion-item *ngFor="let item of items"> <ion-avatar item-left> <img src="{{item.logo}}" /> </ion-avatar> <h2>{{item.name}}</h2> <button clear (click)="changeIcon(shop)" item-right> <ion-icon name="ios-heart-outline" ></ion-icon> </button> </ion-item> </ion-list> and I want to change this icon to ios-heart after click on button. 回答1: Just like you can see in Ionic2 docs you can set the icon using a variable like this: In your

convert audio file to base64 in ionic 3

自古美人都是妖i 提交于 2020-01-16 18:03:27
问题 I am trying to save an audio and send it to the server in ionic 3. record(){ if (this.platform.is('ios')) { this.fileName = 'record'+new Date().getDate()+new Date().getMonth()+new Date().getFullYear()+new Date().getHours()+new Date().getMinutes()+new Date().getSeconds()+'.3gp'; this.filePath = this.file.documentsDirectory.replace(/file:\/\//g, '') + this.fileName; this.audio = this.media.create(this.filePath); } else if (this.platform.is('android')) { this.fileName = 'record'+new Date()

ionic 3 - can't store to storage after http request

…衆ロ難τιáo~ 提交于 2020-01-16 17:02:07
问题 I already read the docs regarding Ionic Storage and have already imported what is needed. But still can't seem to get it to work. When I check the localStorage of chrome (I use 'ionic cordova run browser'), it's empty. Here's my code: cordova.plugin.http.sendRequest('http://127.0.0.1:5000/api/login/', options, function(response) { try { //onSuccess response.data = JSON.parse(response.data); this.store.set('token', JSON.stringify(response.data.token)); this.navCtrl.setRoot(HomePage); } catch(e

Tabs Root elements not visible

早过忘川 提交于 2020-01-16 14:39:09
问题 I'm building ionic apps its has multi-account switch option. My problem is first time its Tabs root elements page visible good but when its switch to another account with specific tabs then its visible before render page. I will show my code for your better understand. app.components.ts import {Component, ViewChild} from '@angular/core'; import {Nav, Platform, PopoverController} from 'ionic-angular'; import { StatusBar } from '@ionic-native/status-bar'; import { SplashScreen } from '@ionic