angularfire

AngularFire 0.82 - How to query denormalised data?

我们两清 提交于 2019-12-08 12:35:09
问题 This question is similar to AngularFire - How do I query denormalised data? but I really do want an answer that uses AngularFire (current version is 0.82). This is an example of the data structure I use: { "users": { "user1": { "name": "Alice", "lists": { "list1": "true" } }, "user2": { "name": "Bob", "lists": { "list2": "true" } } }, "lists": { "list1": { "title": "Example" }, "list2": { "title": "Example2" } } } or, in a different notation: to get all of one user's lists we need all of

AngularFire: how to run join queries

微笑、不失礼 提交于 2019-12-08 12:23:11
问题 I'm working in a project where I have these entities: region, messages and a link between region and messages. In this link I also can configure some extra properties such as if the message can be show more than once for a region and if there is a pre-requisite message to be show before. My basic database concept: Below is how I'm making my database: I would like to be able to show a list with the message name, the show flag and the name of the pre-requisite message, if filled. I'm using the

How to count child elements in angularfire?

孤人 提交于 2019-12-08 11:48:03
问题 Hi I am using angularfire for my app I am listing my service and controller here. I am planning to get the count of comments which has been added to a particular post. this is my controller app.controller('PostViewCtrl', function ($scope, FIREBASE_URL,$routeParams, Post, Auth, $timeout,$interval,$http, $rootScope, $firebase) { var ref = new Firebase(FIREBASE_URL); $scope.post = Post.get($routeParams.postId); $scope.comments = Post.comments($routeParams.postId); $scope.user = Auth.user; $scope

Correct way to model a collection of items in Firebase

半世苍凉 提交于 2019-12-08 11:42:23
问题 In the docs I see a lot of examples using index values as a part of the key name for a particular item --- but I don't understand how this is a consistent way to model your data. For example let's say I have a list of articles: https://gigablox.firebaseio.com/articles/ article1 article2 article3 When I'm ready to add article4 I know I can use: var length = Object.keys($scope.articles).length; And using AngularFire 0.5.0 I can save it with: var name = 'article' + length + 1; $scope.articles

Find object in Firebase by one value

允我心安 提交于 2019-12-08 11:35:06
问题 I have next database list (usernames + user id). How can i find object by user id and change his key (username)? I'm using AngularFire2 with Angular 5. 回答1: You can find a child node by its value with a query like this: var users = firebase.database().reference("usernames"); var query = users.orderByValue().equalTo("Sk6I..."ltA2"); By attaching a listener to this query you'll be able to find the reference and the key of the user (or "any users", since technically there may be more keys with

Cordova Plugin Firebase not working with Ionic 3 run android

自闭症网瘾萝莉.ら 提交于 2019-12-08 11:13:03
问题 I am doing a test app using the plugin cordova-plugin-firebase to do Push Notifications, following this tutorial: https://angularfirebase.com/lessons/ionic-native-with-firebase-fcm-push-notifications-ios-android/ . The problem appears when I try to compile the project with android with the following command: ionic cordova run android giving me a build failed where the error is the follows: Could not find support-v4.aar (com.android.support:support-v4:26.1.0) . Do you guys have some idea about

how to make angularfire send ng-grid onBlur changes to firebase automatically?

落花浮王杯 提交于 2019-12-08 09:54:50
问题 This is a followup question from here: How to create 3 way data binding between angularFire 0.5.0 and latest ng-grid? where Kato nicely provided a solution: var app = angular.module('app', ['firebase', 'ngGrid']); var fb = new Firebase('https://nggrid-example.firebaseio-demo.com/'); app.controller('ctrl', function($firebase, $scope, orderByPriorityFilter) { $scope.data = $firebase(fb); $scope.myData = $firebase(fb); $scope.$watchCollection('data', function() { $scope.myData =

Firebase load performance

女生的网名这么多〃 提交于 2019-12-08 07:38:52
问题 Simple console timing shows that fb loads much slower than desired (just 50 chat items). load: 171.226ms fbload: 1723.570ms load: 182.672ms fbload: 2143.836ms The normal load is from my mongodb and fbload is firebase. Despite my mongo being not denormalized fb is order of magnitude slower. Is there something I can do to increase performance? I'm using angularfire and I can load the initial from my own database and then replace it with the fb data. For this solution is there some way I can get

Get User Auth Profile Info in Firebase using Angular2

安稳与你 提交于 2019-12-08 06:36:09
问题 Can you help me? I can't get the user's profile information in Angularfire Authentication like their facebook's profile picture or facebook name. Please help. Thanks a lot! I've tried this code but its not working. I use Angular 2 TypeScript. var user = firebase.auth().currentUser; var name, email, photoUrl, uid; if (user != null) { name = user.displayName; email = user.email; photoUrl = user.photoURL; uid = user.uid; // The user's ID, unique to the Firebase project. Do NOT use // this value

AngularFire 0.5.0 $on 'change' event not firing correctly

冷暖自知 提交于 2019-12-08 05:27:01
问题 Let's say I have a collection of articles I am trying to paginate through. I'm using the $on("change") event to listen for changes to index and limit .controller('articlesCtrl', ["$scope", "$firebase", "$stateParams", function($scope, $firebase, $stateParams) { var limit = 2; var index = $stateParams.id; var articlesRef = new Firebase("https://example.firebaseio.com/articles").startAt(null, index).limit(limit); var obj = $firebase(articlesRef); obj.$on("change", function() { var keys = obj.