angularfire

Where to put duplicate calls to firebase in angularjs app?

只谈情不闲聊 提交于 2019-12-11 11:30:08
问题 I need to get a set of products from firebase in every controller, and it would be ideal if I don't have to make an API call every single time. What is the best way to achieve this with the angularfire library? https://www.firebase.com/docs/web/libraries/angular/api.html#angularfire-firebasearray Right now I have (in coffeescript): app = angular.module 'EApp', ['ui.router', 'firebase'] app.config ($stateProvider, $urlRouterProvider) -> $stateProvider .state 'catalog', url: '/catalog'

How to navigate object returned from AngularFire?

坚强是说给别人听的谎言 提交于 2019-12-11 10:20:43
问题 When I run the following Firebase query: var ref = new Firebase('https://<myfirebase>.firebaseio.com/companies/endo/status'); data = $firebaseObject(ref); console.dir(data); I get the following object: d $$conf: Object $id: "status" $priority: null Active, not recruiting: 39 Approved for marketing: 1 Completed: 339 Enrolling by invitation: 10 Not yet recruiting: 23 Recruiting: 128 Suspended: 3 Terminated: 38 Unknown: 74 Withdrawn: 15 __proto__: Object I am trying to access the "Completed"

How would I convert my new Object data I am retrieving from Firebase into the JSON form as I had before

不羁岁月 提交于 2019-12-11 10:08:30
问题 I just set up my Firebase, angularFire database with my Yeoman, AngularJS app. I use to hard code my data before like so $scope.data = [ { name: 'NAME', description: 'DESCRIPTION', type: 'TYPE', etc: 'ETC', etc: 'ETC', etc: 'ETC'... }, { name: 'NAME', description: 'DESCRIPTION', type: 'TYPE', etc: 'ETC', etc: 'ETC', etc: 'ETC'... }, { name: 'NAME', description: 'DESCRIPTION', type: 'TYPE', etc: 'ETC', etc: 'ETC', etc: 'ETC'... }, ... ... More Data... ... ... { name: 'NAME', description:

How to secure Angular routes with Firebase v3?

我的梦境 提交于 2019-12-11 08:49:20
问题 I want to protect various routes on my site using Firebase V3, AngularJS and ui.router. This looks like a similar issue. I've followed the steps from that SO post but its not working for me. What I expect to happen: When clicking the FAQ link I should be forwarded to the login page if logged out and should display the FAQ page when logged in. What actually happens: FAQ page isn't accessible at all. Logging in doesn't make any difference. It also doesn't forward me to the login page when

angular-google-maps API key from backend

五迷三道 提交于 2019-12-11 07:11:56
问题 Generally, this question is about how to use some dynamic content from a backend inside a module.config function in AngularJS. Specifically, this question is regarding the GoogleMapApi provider in angular-google-maps In my Angular Application the Google Maps API key is stored in a Firebase backend. What I would like to do is to set the API key for the GoogleMapApiProvider .config(function(uiGmapGoogleMapApiProvider) { uiGmapGoogleMapApiProvider.configure({ key: 'your api key', }); }) I know

Authorized Request Origins is not restricting domain access in Firebase?

有些话、适合烂在心里 提交于 2019-12-11 06:09:22
问题 I'm building an application using AngularFire + Firebase. To prevent new users from being created, and authenticated, from domains other than my application's domain, I'm trying to use the Authorized Request Origins feature in Firebase. Currently, it is only configured to allow authentication from localhost . However, when I create a new user using the createUser API from my application's domain, the user gets created in my Firebase. This should not happen since I used "err" from createUser

How to get the key of a firebaseArray object

亡梦爱人 提交于 2019-12-11 05:44:22
问题 I am trying to get the key for a returned firebaseArray record but am having no luck. I have aservice that runs the following to return a store getStore: function(uid, id){ var ref = firebase.database().ref('u/'+uid+'/stores/'+id+'/i/'); // to take an action after the data loads, use the $loaded() promise return $firebaseArray(ref); } I use the following to get eeach record by calling the service for(var i = 0; i < $scope.storesList.length; i++){ var storeInfo = Stores.getStore($rootScope

On Auth State changed AngularFire

a 夏天 提交于 2019-12-11 05:08:27
问题 Trying to authenticate an user using firebase. Started my app using firebase 2.xx but even after upgrading to Firebase 3.xx, throwing error "onAuthStateChanged is not a function". This is how my login function looks like- .controller('HomeCtrl', ['$scope','$location','CommonProp','$firebaseAuth', '$firebaseObject',function($scope,$location,CommonProp,$firebaseAuth,$firebaseObject) { var firebaseObj = $firebaseObject(rootRef); var loginObj = $firebaseAuth(firebaseObj); $scope.SignIn = function

initialize firebase in angular 6 without angularfire

五迷三道 提交于 2019-12-11 04:06:12
问题 I want had a project that initialize firebase by using AngularFire. However, during the entire development I didn't use much function from AngularFire. I always import the firebase/app at every services and use the respective function like firebase.auth() or firebase.database() . With that experience, I would like to initialize the firebase without AngularFire since I am not using the AngularFire methods. Now come with my problem is I can't find any source to teach me how to initialize the

Firebase - Is there a flag to force long polling when websockets are blocked by corporate proxy/firewall?

折月煮酒 提交于 2019-12-11 03:31:49
问题 I'm developing a simple corporate AngularJS app and was planning on using Firebase for the backend. The browsers I have to support are IE8 and Chrome (latest). I have managed to fix all of the IE related quirks in the front end and can successfully retrieve data from my Firebase. As IE8 does not have support for WebSockets I assume it is using long polling. (this is fine performance-wise, the app is very simple and just pulls/updates two or three pieces of data). Paradoxically, I am seeing