ionic3

angular 4: load components one by one

百般思念 提交于 2019-12-04 19:26:12
I'm using Ionic 3 with based on angular 4 framework. And I need to know if I have multiple children components can I load them asynchronously, one by one: Load parent; Load first child; When first child loaded, load second child; When second child loaded, load third child and so on For example I have a parent component app.module.ts with children: @NgModule({ declarations: [ AppComponentPage ], imports: [ IonicPageModule.forChild(AppComponentPage), ChildOneComponentModule, ChildTwoComponentModule, ChildThreeComponentModule, ChildFourComponentModule, ], entryComponents: [ AppComponentPage ]})

How can you reference template input variable 'hero' from *ngFor=“let hero of heros” inside Typescript

风流意气都作罢 提交于 2019-12-04 19:24:12
How can you reference template input variable hero from *ngFor="let hero of heros" inside Typescript? I'm using a stateful component So code has this for the 'heros' equivalent in my code is: servers: Server[]; It is populated when screen first appears via ionViewDidLoad. When I add the server via button at bottom, ionViewDidEnter calls same loading method to populate servers again. When debugging I'm going via ionViewDidLoad path. [ Probably you can pass it inside a function <div *ngFor="let hero of heros"> <li click="print(hero)">{{hero}}</li> </div> and inside TS, print(hero:Hero){ console

Ionic InAppBrowser on Android doesn't navigate to custom Url Scheme

别等时光非礼了梦想. 提交于 2019-12-04 18:41:44
I am having a setup, where I open a url in the plugin InAppBrowser with target '_blank'. The plugin Deeplinks is also installed and configured. const browser: InAppBrowserObject = this.iab.create(url, '_blank', <InAppBrowserOptions>{ location: "no", toolbar: "no", footer: "no" }); browser.on('loadstart').subscribe((event: InAppBrowserEvent) => { console.log(event); if (event.url.indexOf('wflwr://payment/success') > -1) { browser.close(); } if (event.url.indexOf('wflwr://payment/cancel') > -1) { browser.close(); } if (event.url.indexOf('wflwr://payment/error') > -1) { browser.close(); } }); I

Download file in ios for ionic 3 not showing in files folder

徘徊边缘 提交于 2019-12-04 17:44:32
ionic 3 I am using #cordova-plugin-file-transfer, to download the file from url in android and ios. For Android it is working fine. But for ios app, i am facing a problem. The file is downloading successfully, but i am not able to see downloaded file on ios device. Here is my code for ios => const transfer = this.transfer.create(); transfer.download(url, cordova.file.documentsDirectory + fileName).then( entry => { console.log(entry); this.apiService.showError("Download Succeeded."); this.commonService.dismissLoading(); }, error => { console.log(error); this.apiService.showError("Download

Ionic 2 Print function to POS printer using USB

╄→гoц情女王★ 提交于 2019-12-04 17:42:08
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

Streaming MJPEG images and memory build up - Angular2 HTTP handling for images - is there a way?

喜夏-厌秋 提交于 2019-12-04 17:28:50
I have a problem related to how browsers handle persistence of <img src> connections for which I can't figure out a solution. I had posted a question here about an approach but the problem is actually wider, so I thought I'd post a more generic question that takes a step back. This problem is not unique to Angular2 (I faced the same problem in Angular1, and did some ugly hacks which I'll describe later, and want to know if there is a better way in Angular2+) Problem Statement: I have to work with a back end server (3rd party) that streams images on a continuous basis from an IP camera. The

Error to compile Ionic 3 with Cordova: cordova\\node_modules\\cordova-common\\src\\superspawn.js:169:23

本小妞迷上赌 提交于 2019-12-04 17:03:02
In Ionic 3 with Cordova when I give the command: ionic cordova run android --emulate It gives the following message: BUILD FAILED in 3s at ChildProcess.whenDone (C:\wellfitapp\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) (node:9040) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a

Ionic Build throws the following error: “could not find any matches for com.android.tools.build:gradle:+”

北城以北 提交于 2019-12-04 16:59:07
I'm developing an Ionic app and my builds were working fine two days ago, but suddenly today they're failing. It seems it's about the FMC dependencies, since one of them is classpath 'com.android.tools.build:gradle:+' and the error I'm getting is Could not find any matches for com.android.tools.build:gradle:+ . Plus I'm getting this message: FAILURE: Build failed with an exception. * Where: Build file '/home/patricio/infomigra_app/platforms/android/build.gradle' line: 95 And the line 95 is where it tries to apply the FCM plugin with the following command: apply from: "cordova-plugin-fcm

Can ionic2's pages support nested directory structure?

雨燕双飞 提交于 2019-12-04 16:55:16
I see the pages directory of many Ionic 2 projects is a flatted structure like below (if we use its generation command, the generated directory structure is flatted). e.g. pages/ |- login/ | |-login.html | |-login.scss | |_login.ts |- logout/ | |-logout.html | |-logout.scss | |_logout.ts |- order-list/ | |-order-list.html | |-order-list.scss | |_order-list.ts |- order-detail/ | |-order-detail.html | |-order-detail.scss | |_order-detail.ts But if a project includes many pages, i hope the pages directory supports sub directories like below: e.g. pages/ |- auth/ | |- login/ | | |-login.html | | |

Ionic build: difference between --prod and --release flags?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 16:13:19
问题 When running an ionic build I'm curious as to the difference between the --prod and --release flags? The Ionic build docs state: --prod Build the application for production --release Create a Cordova release build and while the Cordova CLI ref doesn't mention a --prod flag, it states the following for --release : Perform a release build. This typically translates to release mode for the underlying platform being built. Looking at the difference in the build output, building with --prod seems