ionic2

Error: No Firebase App '[DEFAULT]' has been created

烂漫一生 提交于 2020-08-25 01:57:53
问题 I'm using Ionic2 and when I go to localhost:8100 (after doing ionic serve ) I receive the error you can see in the following image. app.component.ts looks like this: import firebase from 'firebase'; import { Component } from '@angular/core'; import { Platform } from 'ionic-angular'; import { StatusBar } from 'ionic-native'; import { HomePage } from '../pages/home/home'; @Component({ template: `<ion-nav [root]="rootPage"></ion-nav>` }) export class MyApp { rootPage = HomePage; constructor

Iterating through a FormArray containing FormGroups with *ngFor

喜欢而已 提交于 2020-08-22 05:42:59
问题 In Ionic 2 I am trying to create a dynamic form which shall display a list of toggle buttons. To do so I am trying to use a FormArray and relied on the Angular doc and mainly on this post Based on this, I implemented the following <form *ngIf="accountForm" [formGroup]="accountForm"> <ion-list> <!-- Personal info --> <ion-list-header padding-top> Informations personnelles </ion-list-header> <ion-item> <ion-label stacked>Prénom</ion-label> <ion-input formControlName="firstname" [value]="(user |

Iterating through a FormArray containing FormGroups with *ngFor

耗尽温柔 提交于 2020-08-22 05:42:19
问题 In Ionic 2 I am trying to create a dynamic form which shall display a list of toggle buttons. To do so I am trying to use a FormArray and relied on the Angular doc and mainly on this post Based on this, I implemented the following <form *ngIf="accountForm" [formGroup]="accountForm"> <ion-list> <!-- Personal info --> <ion-list-header padding-top> Informations personnelles </ion-list-header> <ion-item> <ion-label stacked>Prénom</ion-label> <ion-input formControlName="firstname" [value]="(user |

Using Slice Pipe with variable parameters in *ngFor

旧城冷巷雨未停 提交于 2020-08-04 03:45:01
问题 Using the Angular2 pipe slice I can do something like this to only show the first five elements of my items . <ion-item *ngFor='let item of items | slice:0:5"> How can I use variables instead of hardcoding 0 and 5? I want to do something like this and define start and end in my *.ts file. <ion-item *ngFor='let item of items | slice:"start":"end"'> 回答1: Just remove " (double quotes) from the start and end variable <ion-item *ngFor='let item of items | slice:start:end'> 来源: https:/

Using Slice Pipe with variable parameters in *ngFor

浪子不回头ぞ 提交于 2020-08-04 03:43:08
问题 Using the Angular2 pipe slice I can do something like this to only show the first five elements of my items . <ion-item *ngFor='let item of items | slice:0:5"> How can I use variables instead of hardcoding 0 and 5? I want to do something like this and define start and end in my *.ts file. <ion-item *ngFor='let item of items | slice:"start":"end"'> 回答1: Just remove " (double quotes) from the start and end variable <ion-item *ngFor='let item of items | slice:start:end'> 来源: https:/

Set an image as background in ion-slide

痞子三分冷 提交于 2020-07-20 17:24:45
问题 I am trying to do an intro for an app with < ion-slides page> , my problem comes to set an image as background, I am trying to do this on my HTML: <ion-header> <ion-navbar> <ion-title>Intro</ion-title> </ion-navbar> </ion-header> <ion-content padding> </ion-content> <ion-slides pager> <ion-slide style="background-image: url(/../../www/img/fondo.png)"> <h2>Slide 1</h2> </ion-slide> <ion-slide style="background-color: mediumpurple"> <h2>Slide 2</h2> </ion-slide> <ion-slide style="background

Set an image as background in ion-slide

天大地大妈咪最大 提交于 2020-07-20 17:24:33
问题 I am trying to do an intro for an app with < ion-slides page> , my problem comes to set an image as background, I am trying to do this on my HTML: <ion-header> <ion-navbar> <ion-title>Intro</ion-title> </ion-navbar> </ion-header> <ion-content padding> </ion-content> <ion-slides pager> <ion-slide style="background-image: url(/../../www/img/fondo.png)"> <h2>Slide 1</h2> </ion-slide> <ion-slide style="background-color: mediumpurple"> <h2>Slide 2</h2> </ion-slide> <ion-slide style="background

Set an image as background in ion-slide

笑着哭i 提交于 2020-07-20 17:24:08
问题 I am trying to do an intro for an app with < ion-slides page> , my problem comes to set an image as background, I am trying to do this on my HTML: <ion-header> <ion-navbar> <ion-title>Intro</ion-title> </ion-navbar> </ion-header> <ion-content padding> </ion-content> <ion-slides pager> <ion-slide style="background-image: url(/../../www/img/fondo.png)"> <h2>Slide 1</h2> </ion-slide> <ion-slide style="background-color: mediumpurple"> <h2>Slide 2</h2> </ion-slide> <ion-slide style="background

Error: xcode-select: error: tool 'xcodebuild' requires Xcode

可紊 提交于 2020-06-25 04:20:05
问题 I am using Ionic 2 . The app builds an Android apk successfully on Windows. I am now trying to build it for iOS on OSX. When I run: ionic build ios I get the following: Any advise appreciated. 回答1: You need to configure xcode after installation: Open xcode, go to > preferences > locations (tab) > command line tools (dropdown) > set latest version. 来源: https://stackoverflow.com/questions/41116584/error-xcode-select-error-tool-xcodebuild-requires-xcode

Listen to firebase database changes when app is closed

这一生的挚爱 提交于 2020-06-23 11:14:52
问题 I am creating an Ionic 2 app with firebase and I need a way to listen to database changes (specifically on child_added) when the app is closed (I.e. in foreground,background and killed) Basically, I want to use WebRTC to make calls within the app like whatsapp and I am following this post - https://websitebeaver.com/insanely-simple-webrtc-video-chat-using-firebase-with-codepen-demo However, the only thing that puzzles me is how it will work when the app is closed. Can anyone please help me