angularfire

AngularFire Accessing child element methods

跟風遠走 提交于 2019-12-04 16:22:46
I'm looking for a way to get the methods of a child element instead of loading that element separately. Let's say I have a Post model and each post has comments. This is how I get the post model: var post = $firebase(new Firebase(FIREBASE_URL + "/posts/" + post_name)).$asObject(); Each post has comments so I can access the comments using: post.$loaded(function () { var comments = post.comments; } Now how do I push a new element to comments without having to load the model separately from Firebase? I should be able to do the following but it doesn't work: comments.$add({text: "Hi, there"}); Is

Can't get new password authentication methods to work in AngularFire 0.9.0?

泪湿孤枕 提交于 2019-12-04 16:17:06
I'm trying to use the new authentication methods in Angular Fire 0.9.0 but I must be doing something wrong. I'm running 1.3.2 of Angular, 2.0.4 of Firebase and 0.9.0 of Angular Fire. I call the login function from an ng-click in my html. Here is my js : var app = angular.module("sampleApp", ["firebase"]); app.controller('mainCtrl', function ($scope, $firebaseAuth) { var ref = new Firebase('https://XXXX.xxx'); $scope.auth = $firebaseAuth(ref); $scope.login = function() { $scope.num = 'loggin in'; $scope.auth.$authWithPassword({ email: 'xxx@xxx.xxx', password: 'yyyyy' }, function(err, authData)

Client doesn't have permission to access the desired data in Firebase

╄→尐↘猪︶ㄣ 提交于 2019-12-04 15:47:04
问题 I have a page that is calling addCheckin() method which is inside a controller. In the controller, I am trying to create a reference as follows: var ref = firebase.database().ref("users/" + $scope.whichuser + "/meetings/" +$scope.whichmeeting + "/checkins"); $scope.whichuser and $scope.whichmeeting are the $routeParams that I am passing from another route. Here's my checkin controller- myApp.controller("CheckinsController", ['$scope','$rootScope','$firebaseArray','$routeParams','

Firebase angularfire in new firebase

北战南征 提交于 2019-12-04 14:43:35
问题 I have an angular app, which utilizes the angularFire library. It is stated in the firebase documentation that angularfire is supported https://firebase.google.com/support/guides/firebase-web#update_your_firebase_libraries_numbered I have updated firebase and angularfire to the latest version. BEFORE: //This works :-) // *** DataService *** var root = new Firebase(FIREBASE_URL); var service = { root: root, items: root.child('items'), tastings: root.child('tastings'), users: root.child('users'

How do you change the email associated with a user in firebase simple login?

喜你入骨 提交于 2019-12-04 14:18:29
问题 As the title suggests I would like to provide functionality to allow a user to update the email they use to login to my app using Firebase Simple Login. Cannot figure out an elegant way to do this. App uses AngularFire if that is relevant. Does one exist or do I need to create a new account and delete the old one using the $removeUser() and $createUser() methods? 回答1: Update for Firebase 2.1.x The Firebase SDK now provides a changeEmail method. var ref = new Firebase('https://<instance>

Firebase's AngularFire in an AngularJS service

本小妞迷上赌 提交于 2019-12-04 11:00:27
问题 The best way of handling Firebase in AngularJS surely has to be from within a service, so it's available to all Controllers across the App. I just can't get it to work! ... I first tried using angularFire(new Firebase(url)) , hoping I could bind to the service's scope, but Angular complains that it cannot $watch it. So I tried angularFireCollection instead like this: app.factory('myService', function myService(angularFireCollection) { var url = 'https://myfirebase.firebaseio.com'; return {

FirebaseListObservable becomes Observable after query

六月ゝ 毕业季﹏ 提交于 2019-12-04 09:54:53
I made a small app on firebase. I have been using a type provided by angularfire called a FirebaseListObservable which allows you to observe changes to your data. The problem I'm having is that Angularfire also provides a way to query the data, by attaching / passing in a query object to the request. The following returns a FirebaseListObservable. this.resources$ = <FirebaseListObservable<IResource[]>> this.af.list(`/resources/${this.auth.id}`) as FirebaseListObservable<IResource[]>; //This returns a regular observable. this.resources$ = <FirebaseListObservable<IResource[]>> this.af.list(`

TypeError: undefined is not a function with Firebase and AngularJS (ThinksterIO Tutorial Chapter 7)

有些话、适合烂在心里 提交于 2019-12-04 06:15:35
问题 Update The tutorial has been updated and the question is now outdated I've run into multiple issues with the Thinkster.io AngularJS Tutorial: Learn to build Modern Webapps Chapter 7. Creating your own user data using firebase. The first had to do with saving a new user to the Firebase Forge which thankfully was solved by Anna Smother in her SO post AngularJS tutorial Thinkster.io chapter 7 but now I am getting two TypeErrors after registering a new user. I will explain what happens when I

Copy a $firebaseObject and save it to a different location

你说的曾经没有我的故事 提交于 2019-12-04 06:04:15
问题 In my application i'm getting an object from my firebase using $firebaseObject. The use has two options with this object, change it and save the changes in the object or change it and save it as a new version. My problem is getting the second option to work. For the first i can simply use $save() and it works perfectly but so far i haven't been able to make a copy of the object and save it in a different location in my firebase. So far i have tried: Saving the actual object in a different

How to enable route security when using AngularFire with Angular ui-router?

谁说我不能喝 提交于 2019-12-04 05:49:13
Is it possible to use the AngularFire routeSecurity module with angular UI-ROUTER instead of the standard ng-route provider? Is there a version of routeSecurity that would work with ui-router? @mattvv Gave me this gist while I was talking on him in the angular irc channel. So essentially you would just need to replace the routesecurity.js file in angularfire directory assuming that you used yeoman to scaffold your application. A neat thing to do is just to create another file named routesecurity-ui-router.js instead of replacing the content of the routesecurity.js . So to give a little bit of