Search Posts

Category: angularfire2

Add Angularfire2 Object value into click function

I have angularfire2 objects this.mapLat = afDB.object(‘mapLat’).valueChanges(); this.mapLong = afDB.object(‘mapLink’).valueChanges(); I want generate google map url like this: gotoMap(mapLat, Maplong) { return “https://maps.google.com/?ll=” + mapLat + “,” + Maplong; } so output will be: https://www.google.com/maps?ll=38.882147,-76.99017 inside gotoMap() I want use 2 value {{ mapLat | async }} {{ mapLong | async }} <button ion-button large color=”lgreen” (click)=”gotoMap()” block>Ă…ben i google maps</button> but it gives me syntax error, please suggest me correct syntax. <button ion-button large […]

AngularFirstore is not defined

I am doing a simply angular app with angularfire and firebase. But I have a problem with Angularfire. The error on console says: Uncaught ReferenceError: AngularFirstore is not defined at eval (app.module.ts:15) at eval (app.module.ts:18) my app.modudule.ts is import { BrowserModule } from “@angular/platform-browser”; import { NgModule } from “@angular/core”; import { AppComponent } from “./app.component”; import { AngularFireModule } from “angularfire2”; import { environment } from “../environments/environment”; import { AngularFirestore } from ‘angularfire2/firestore’; @NgModule({ […]

Angularfire2 – Query async not working

Good day, I have APP With: ionic 3 Firebase Angularfire2 TransactionsPage I’m pushing data on button click with current timestamp Firebase node: transactions HomePage var timestamp = Date.now() – 1 * 60 * 1000; this.transactions = db.list(‘/transactions’, ref => ref.orderByChild(‘date’).startAt(timestamp)).valueChanges() timestamp is last 1 minute ref.orderByChild(‘date’) is timestamp pushed from transactionsPage HTML HomePage <ion-list no-lines> <ion-item *ngFor=”let tr of transactions | async”> <ion-icon color=”primary” name=”basket” item-start></ion-icon> {{tr.date | date:’EEEE, dd MMMM – HH:mm’ }} </ion-item> […]

how to get last X min – Angularjs

Hello I have connected my ionic app with firebase, I need to get list wich pushed last 5 min ago. I have pushed timestamp in my records in firebase. I have no any code yet for this. but for example: this.transactionsRef = db.list(‘shops’); // Use snapshotChanges().map() to store the key this.transactions = this.transactionsRef.snapshotChanges().map(changes => { return changes.map(c => ({ key: c.payload.key, …c.payload.val() })); }); with this code I can get list of records from firebase. […]

Problems in setting up a basic Ionic/Firebase2 APP

how to Problems in setting up a basic Ionic/Firebase2 APP I am trying to setup the CRUD sample app described in Josh Morony’s blog https://www.joshmorony.com/building-a-crud-ionic-2-application-with-firebase-angularfire/ I am facing two problems which I believe are related to the configuration of my environment and the versions of the various package I have installed. I already tried to clear the cache of nom and then run “npm update”, but nothing has changed. Problem 1. I reached the point […]

AngularFire update data without pulling already existed data value?

Hi is it possible to update data with adding a number to already existed data in db or pulling initial data then adding number to it is a must ? i mean: this.db.object(‘something’).update({ current:+1 // something like that current value is 0 in db. }); or i have to write like this.db.object(‘something’).update({ current:this.current+1 // i pulled current value before this is working of course }); Source: AngularJS

Push firebase uid to multiple locations – Angularfire2 Ionic 3

I have the following which simply pushes a name into the database along with a uid. I would like to store that uid in another location at the same time. How can I achieve this? Im using ionic 3, angularfire2. addName() { let prompt = this.alertCtrl.create({ title: ‘Name of user’, message: “Enter a name for this new user”, inputs: [ { name: ‘Name’, placeholder: ‘Username’ }, ], buttons: [ { text: ‘Cancel’, handler: data => […]

angularjs: Error: Firebase Database (4.3.1) INTERNAL ASSERT FAILED: Missing index implementation for isEmpty

I try to read some data from firebase, but my logic doesn’t work.. the problem seems to occur when I create a database ref. my lib version: AngularJS v1.6.5 AngularFire v2.3.0 Firebase v4.3.1 My firebase db: { “post” : [ null, { “message” : “hi”, “name” : “Mario Rossi” }, { “message” : “hi”, “name” : “Alessia Gallina” }, { “message” : “hi”, “name” : “Stefano Macchi” }, { “message” : “hi”, “name” : “Roberto […]

INTERNAL ASSERT FAILED: Missing index implementation for isEmpty

I try to read some data from firebase, but my logic doesn’t work.. the problem seems to occur when it tries to read the database. my lib version: AngularJS v1.6.5 AngularFire v2.3.0 Firebase v4.3.1 My firebase db: { “post” : [ null, { “message” : “hi”, “name” : “Mario Rossi” }, { “message” : “hi”, “name” : “Alessia Gallina” }, { “message” : “hi”, “name” : “Stefano Macchi” }, { “message” : “hi”, “name” : […]

Authentication angularfire2 and Routes

I’m a beginner angular programmer, I’m doing an app with authentication with social network (Facebook & Google). in the logincomponent.ts indicates me an error, at the part “signInWithFacebook() “this.firebaseAuth.signInWithFacebook()” Property ‘signInWithFacebook’ does not exist on type ‘AngularFireAuth’. and the “this.router.navigate([‘dashboard’])” Property ‘router’ does not exist on type ‘AuthService’.any. I show the codes for if anybody helps me. Thanks for your comments. auth.service.ts import { Injectable } from ‘@angular/core’; import { Router } from ‘@angular/router’; import […]

Next Page »