Search Posts

Category: firebase

Angular $http/$q how to block promise until modal response it resolved?

I have an input that makes a request(google phone auth), sends the user the code then I want to prompt a modal so the user can input the code(wait for modal input), and then return confirmation code to finish the call. The problem right now is that the modal shows and the call continues. Any help/ideas appreciated. I’ve tried by with both of these below methods. single deferred: this.signInWithMobile = function(phoneNumber, appVerifier) { var deferred […]

Firebase AngularJS array map()

I have multiple firebase items that I am looping through and they have name, categoryId, lat, lon. I am trying to calculate a distance from 2 lat,lon (one is the one in firebase), the other is the user’s location. All of this is fine, and I can calculate it fine too. However, how do I inject/map the new variable into the firebase array that I am subscribed to? this.categoryId = this.navParams.get(‘categoryId’); afoDatabase.list(‘/list’, {query: { orderByChild: […]

How to verify schedules

I need to verify if a certain time are between another two. For example: Today: Thursday, 11:39PM The store X is open from 00:00AM to 11:59PM on thursdays (in plural, its recorrent). So, a function isOpen returns true. I have made a workaround for this, writing this on the database (Firebase): { “open” : 7200000, “day” : “Thursday”, “close” : 93540000 } Where open and close is milliseconds from 01/01/1970 In the function I check […]

How to configure AngularFire for Multiple Firebase Projects

I am attempting to configure my AngularFire (2.3.0) – (This uses Angular 1.x) app to handle multiple firebase projects. Firebase has a reference in their docs for this possibility. Here is a snippet of how to initialize a single database. // Initialize Firebase // TODO: Replace with your project’s customized code snippet var config = { apiKey: “<API_KEY>”, authDomain: “<PROJECT_ID>.firebaseapp.com”, databaseURL: “https://<DATABASE_NAME>.firebaseio.com”, storageBucket: “<BUCKET>.appspot.com”, messagingSenderId: “<SENDER_ID>”, }; firebase.initializeApp(config); Here is how you would add another […]

How to return asyncronously return data from firebase to devextreme grid in angular 4

Good day, could you help me with the question? I’m trying to receive data from firebase to devextreme component. I’m using angular4. Here is the code of my html page: <dx-data-grid [dataSource]=”priorities”> <dxi-column dataField=”Priority”></dxi-column> </dx-data-grid> In the class of my component I receive the data from database this way: ngOnInit() { this.ds.list(‘priority’).valueChanges().subscribe( data => { console.dir(data) for(var k = 0; k<data.length; k++){ var prior = new priority(); prior.Prioritie = data[k].toString(); this.priorities.push(prior); } console.dir(this.priorities);} where priorities […]

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 => […]

Firebase – Keep user signed in when redirecting to different page

I have 2 components to my website: The landing page with a sign up form (https://example.com) The single page anuglarjs application (https://app.example.com) What I want to achieve is when the users comes to the landing page, they are able to sign up using Firebase, and once the sign up is complete, redirect the user to the single page application and automatically be signed in, so they don’t have to enter their information again. Here is […]

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” : […]

Next Page »