angularfire

AngularFire used to have a orderByPriority filter

泪湿孤枕 提交于 2019-12-04 05:27:42
问题 From Google result it looks like AngularFire used to have a orderByPriority filter. But I cannot find this in the current AngularFire api docs: https://www.firebase.com/docs/web/libraries/angular/api.html. As I understand it, orderByPriority converted an objects properties into to an array. I guess this filter is gone because there is another and better way to do it now, but what is that method? 回答1: There is no longer a need for orderByPriority since you can utilize a synchronized array,

Firebase $authWithOAuthRedirect doesn't call $onAuth without page refresh

女生的网名这么多〃 提交于 2019-12-04 03:54:37
问题 I have a simple Firebase Facebook OAuth login set like below by following the official tutorial for the Ionic Firebase Facebook login. The problem is that once I click on the login with Facebook button, I get redirected to Facebook, I log in, and I get redirected back to my app. However, the problem is that I stay in the login page. Strange thing is that if I physically refresh my browser (testing with ionic serve ) by pressing F5 the onAuth triggers and I get redirected to the Items page. If

Using firebase facebook auth with facebook graph api

こ雲淡風輕ζ 提交于 2019-12-03 23:13:29
问题 I am using firebase facebook simple login. Is there any way I can use it conjunction with facebook js graph api? Let say, calling FB.api('xxx', function(){}) ? 回答1: Facebook via Firebase Simple Login returns the Facebook access token as part of the payload. You could then use this directly with the Facebook Graph API and their JavaScript SDK: var ref = new Firebase(URL); var auth = new FirebaseSimpleLogin(ref, function(error, user) { if (user) { var facebookToken = user.accessToken; // <<--

How to bypass unique ID and reference child nodes

我的未来我决定 提交于 2019-12-03 22:29:07
问题 My firbase database looks like this: app users -gn4t9u4ut304u9g4 email uid How do I reference email and uid? When I try this: $rootScope.dashtype.child('users').orderByChild('uid').equalTo($rootScope.auth.uid).on('value', function(snapshot){ $rootScope.user = snapshot.val(); console.log($rootScope.user); }) I get the correct object, but with the unique id as root: Object {-JvaZVrWGvJis0AYocBa: Object} And because this is a dynamic property, I don't know how to reference the child objects. I

Working with AngularFireObject and switchMap

与世无争的帅哥 提交于 2019-12-03 21:44:57
I really don't know how to fix this. How can I fix this error? in user.service.ts: import { Injectable } from '@angular/core'; import { AngularFireDatabase, AngularFireList, AngularFireObject } from 'angularfire2/database'; import {AppUser} from './models/app.user'; import * as firebase from 'firebase'; import { Observable } from 'rxjs'; @Injectable({ providedIn: 'root' }) export class UserService { constructor(private db: AngularFireDatabase) { } save(user: firebase.User) { this.db.object('/users/' + user.uid).update({ name: user.displayName, email: user.email }); } get(uid: string):

Get length of an array returned by firebase

China☆狼群 提交于 2019-12-03 20:13:36
The usual .length property of the array doesn't work on the arrays returned by firebase. Here is the console.log of the returned array: 0: Object 1: Object 2: Object 3: Object 4: Object $$added: function () { [native code] } $$error: function () { [native code] } $$moved: function () { [native code] } $$removed: function () { [native code] } $$updated: function () { [native code] } $add: function () { [native code] } $destroy: function () { [native code] } $getRecord: function () { [native code] } $indexFor: function () { [native code] } $inst: function () { [native code] } $keyAt: function ()

How do I get angularFire objects to orderBy with ngRepeat?

醉酒当歌 提交于 2019-12-03 14:58:28
The current bunch of data in my firebase looks something like: {"-JZ7b":{"name":"bob","has":"slack"},"-JZ7a":{"name":"connie","has":"slack"}} If I use something like: <ul><li ng-repeat="(key, person) in people |orderBy 'name'"></li></ul> I get: -JZ7a connie has slack -JZ7b bob has slack here's a fiddle What is the best way to get the expected orderBy without changing my data into some other format ? I realize that in this example the keys aren't exactly meaningful but, assume they are. The idea of a building a custom directive seems like an interesting option but, my code can be a bit jangly

How to get the authenticated user info and use in all controllers and services?

匆匆过客 提交于 2019-12-03 14:08:50
问题 I'm using angularFireAuth and I want to retrieve the logged in user's info and use in all the controllers or services when the app is initial. Currently, I used this in every controller but i having some problem. $scope.$on("angularFireAuth:login", function(evt, user){ console.log(user); }); The callback will not call if it is not a full page load or return null when app initial. I need some tips for how can I return the authenticated user's info so I can use when app is initial and in all

How to get currently logged in auth state/user from angularfire2

雨燕双飞 提交于 2019-12-03 11:52:57
问题 I have an ionic2 app and am using Firebase and angularFire2. I'd like to get the current authentication state and current auth object/user from firebase using angularFire2. Here's what's working so far - I can authenticate the user and subscribe to the FirebaseAuthState to get the facebook user object. constructor(platform: Platform, private auth: FirebaseAuth) { auth.subscribe((user: FirebaseAuthState) => { if (user) { // I could store user in localstorage, but I'd like to see an All

How to implement collaborator invitations using firebase?

做~自己de王妃 提交于 2019-12-03 10:03:26
问题 I am developing an app with firebase and angular and angularfire. I would like to implement a "invite collaborators" feature in much the same way as firebase itself implements collaboration - that is, the app user can enter an email address to invite collaborators which would send an email and generate an "inviteToken", just as is done when inviting collaborators in firebase itself. I understand that security rules (to limit collaborator access) and schema design( a /collaborators 'folder' ?