Search Posts

Category: angularfire

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

Angularfire $firebaseArray extend dynamic countsum

Am trying to achieve a dynamic count of certain node if defined: This works but its not dynamic, you have to call sum(). app.factory(“ArrayWithSum”, function($firebaseArray) { return $firebaseArray.$extend({ sum: function() { var total = 0; var todayDate = new Date(); var start = todayDate.setHours(0,0,0,0); var end = todayDate.setHours(23,59,59,999); // the array data is located in this.$list angular.forEach(this.$list, function(rec) { if (angular.isDefined(rec.qa)){ if (angular.isDefined(rec.qa.completed)) { if (rec.qa.completed >= start && rec.qa.completed <= end){ total++; } } […]

Multiple file upload with firebase and angular

I’m trying to upload multiple image with angular and firebase. How can i get all values and send to Firebase┬┐? Any idea? Thanks! Here is my function: $scope.imgs = $firebaseArray(img); var _validFileExtensions = [“.jpg”, “.jpeg”, “.bmp”, “.gif”, “.png”]; $scope.uploadFile = function() { var sFileName = $(“#nameImg”).val(); console.log(‘images’ + sFileName); if (sFileName.length > 0) { var blnValid = false; for (var j = 0; j < _validFileExtensions.length; j++) { var sCurExtension = _validFileExtensions[j]; if (sFileName.substr(sFileName.length – […]

Child Class auto generates id when pushing data in firebase database

I am trying to push data into by firebase database using angularjs. I used the system as the key and then the equipment as the child, but when i push the data it generates a key and under that it stores the equipment. I want it to store my data like so: System -> Equipment1 -> Equipment2 -> Equipment3 System2 -> Equipment1 -> Equipment2 -> Equipment3 Here is my code: /*global angular*/ var app = […]

"Angular not defined" using Mobile Angular UI and Angularfire

I’m trying to implement a mobile app using mobile angular ui with a firebase data base. But I can’t include firebase without getting this error: Uncaught ReferenceError: angular is not defined at angularfire.min.js:1 at angularfire.min.js:1 I don’t understand why this happens, because I include angular before the other dependencies? (not the “normal” angular but mobile-angular-ui) <!DOCTYPE html> <html> <head> <meta charset=”utf-8″ /> <title>(…)</title> <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″ /> <meta name=”apple-mobile-web-app-capable” content=”yes” /> <meta name=”viewport” content=”user-scalable=no, initial-scale=1.0, […]