ionic2

Listen to firebase database changes when app is closed

我的梦境 提交于 2020-06-23 11:14:21
问题 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

ion-select not showing selected option with FormBuilder (Ionic 3)

六眼飞鱼酱① 提交于 2020-06-16 11:18:24
问题 Take the following html <form [formGroup]="detailsForm"> <ion-list> <ion-item> <ion-label>Gaming</ion-label> <ion-select formControlName="gaming"> <ion-option value="nes">NES</ion-option> <ion-option value="n64">Nintendo64</ion-option> <ion-option value="ps">PlayStation</ion-option> <ion-option value="genesis">Sega Genesis</ion-option> <ion-option value="saturn">Sega Saturn</ion-option> <ion-option value="snes">SNES</ion-option> </ion-select> </ion-item> </ion-list> </form> And in your

Property 'coords' does not exist on type 'MouseEvent'. In Angular2-google-maps marker event

你。 提交于 2020-06-12 05:41:08
问题 I have added mapClicked event of angular2-google-maps map. The code is as below: mapClicked($event: MouseEvent) { this.markers.push({ lat: $event.coords.lat, lng: $event.coords.lng, draggable: false }); } I am getting compile time error while serving my ionic 2 app with "ionic serve". Thanks in advance, AB 回答1: This is just Typescript complaining since the default MouseEvent interface doesn't have the coords property, but since you're using angular2-google-maps you know the coords property

Why white screen stuck after splash screen in Ionic 4?

时间秒杀一切 提交于 2020-06-08 07:16:13
问题 I run ionic cordova run android for my Ionic Cordova project. At this time, I have my mobile connected to PC via USB. So when I run that command, it installs the app on my real device Android Redmi Note 6 PRO. But what really happens is when the app opens, only white screen appears, nothing else at all. First it shows splash screen and then white screen forever. Why does this behaviour happen? I read somewhere that some people had this problem because of Ionic 4. Below are my logcat logs from

How can i easily concatenate typescript variable with string in html tag

穿精又带淫゛_ 提交于 2020-06-07 21:13:18
问题 This is my html code with ionic 2 <ion-item *ngFor="let job of allFreeJobs;let elementid=index"> <p> <span id="m{{elementid}}" (click)="showMore(elementid)" color="primaryAdmin">...<ion-icon name="bicycle"></ion-icon></span> </p> </ion-item> From the code above this is my area of concentration ... id="m{{elementid}}" ... How can I easily concatenate m with the variable elementid. This is not working for me. 回答1: As explained in Angular documentation, you can use interpolation: id="{{'m' +

ionic 2: Display array of items in a 3x3 table

萝らか妹 提交于 2020-05-30 10:11:08
问题 I have an array of items I would like to display in a 3x3 table like display as follows: In order to achieve that, I sliced my array into 3 arrays of 3 and displayed it as follows: <ion-grid no-padding class="home-gallery"> <ion-row *ngFor="let row of items | async"> <ion-col *ngFor="let item of row"> <div class="products_list"> <div class="products_list_img"> <img [src]="item.previewImage" (click)="showItem($event, item)"/> </div> </div> </ion-col> </ion-row> </ion-grid> Is there a way to

Ionic change background color of div by code

跟風遠走 提交于 2020-05-29 07:34:08
问题 How to change the color of a div in code dynamically in ionic by using code? 回答1: If it's just a single style, you can use property binding for this. In your component: public aColor: string = "#ccc"; And then in the view: <div [style.background-color]="aColor"></div> Please take a look at the ngStyle docs for more info if you need to set more than one style dynamically: <some-element [ngStyle]="{'font-style': styleExp}">...</some-element> <some-element [ngStyle]="{'max-width.px': widthExp}">

Ionic change background color of div by code

 ̄綄美尐妖づ 提交于 2020-05-29 07:33:37
问题 How to change the color of a div in code dynamically in ionic by using code? 回答1: If it's just a single style, you can use property binding for this. In your component: public aColor: string = "#ccc"; And then in the view: <div [style.background-color]="aColor"></div> Please take a look at the ngStyle docs for more info if you need to set more than one style dynamically: <some-element [ngStyle]="{'font-style': styleExp}">...</some-element> <some-element [ngStyle]="{'max-width.px': widthExp}">

How can i find `SENDER ID` in firebase?

别来无恙 提交于 2020-05-25 18:40:04
问题 I am creating Push notification demo in ionic 2. I have tried to generate server key and sender key from firebase. i have follow this tutorial. but I can not found cloud messaging tab in my firebase project setting screen as shown bellow image and there is no Server key and sender Id . I need SENDER ID for create push notification in my app as bellow, cordova plugin add phonegap-plugin-push --variable SENDER_ID=12341234 --save 回答1: Here is the steps, Go to Firebase Console Select your project

How can i find `SENDER ID` in firebase?

蓝咒 提交于 2020-05-25 18:39:05
问题 I am creating Push notification demo in ionic 2. I have tried to generate server key and sender key from firebase. i have follow this tutorial. but I can not found cloud messaging tab in my firebase project setting screen as shown bellow image and there is no Server key and sender Id . I need SENDER ID for create push notification in my app as bellow, cordova plugin add phonegap-plugin-push --variable SENDER_ID=12341234 --save 回答1: Here is the steps, Go to Firebase Console Select your project