angularfire

Firebase 3 way data binding not working as expected

最后都变了- 提交于 2019-12-11 03:29:56
问题 I have an AngularJS service that returns a firebase ref. .factory('sessionManager', ['$firebase','$scope', function($firebase){ var ref=new Firebase('https://telechat.firebaseio.com/sessions'); return $firebase(ref); }]) In the controller, I have added the dependency and called $bind . $scope.items=sessionManager; $scope.items.$bind($scope,'sessions').then(function(unbind){ unbind(); }); But when I print it to the console, the returned data has a collection of functions like $add , $set ,..

angularfire: the difference between waitforAuth and requireAuth

泪湿孤枕 提交于 2019-12-11 03:18:41
问题 So I am using requireAuth() from firebase to develop a web app using gulpJs , angularJs and Firebase of cause. I am quite new to the three things. requireAuth() method works great in my app, searching up stuff online, I came across $waitForAuth() and I still can't figure out the difference. From the name, one will wait for authentification but requireAuth() (will obviously also wait right?). When is it ideal to use the $waitForAuth() and when is it ideal to use requireAuth() . myApp.factory(

Why do I see a “400 (Bad Request)” in my developer console when sign-in to Firebase Authentication fails?

六月ゝ 毕业季﹏ 提交于 2019-12-11 02:16:38
问题 I'm using the method signInWithEmailAndPassword to validate a user in my angular based application, I wrote this code: firebase.auth().signInWithEmailAndPassword(email, password).then( function(authData) { //user was validated console.log(authData); }, function(error) { if(error){ // Handle Errors var errorCode = error.code; var errorMessage = error.message; // [START_EXCLUDE] if (errorCode === 'auth/wrong-password') { alert('Wrong password.'); } else { alert(errorMessage); } } }); When I run

AngularFire / Firebase - checking the authentication state

ε祈祈猫儿з 提交于 2019-12-11 01:47:18
问题 Note : I'm new to all of this, please excuse what might be obvious. Any help is massively appreciated :) What I have An auth service to log in and out An album service to fetch items based on user id albumList > UserId > albumKey In my album list service I query the path 'albumList > userId' Once I log in, this works perfectly, and only the results based on the matched query of the above are returned Issues If I were to copy and paste the URL of 'localhost:4200/albums' into another tab, the

“undefined is not a function” error using angularFire

六眼飞鱼酱① 提交于 2019-12-10 22:09:24
问题 i am trying to display data from firebase and i have below code. I already declared firebase dependency for my app. .controller('AdvMainCtrl', ['$scope', 'dataLoad', function($scope, dataLoad, $route, $routeParams, $location, $resource, angularFire) { var categoryPromise = dataLoad.loadCategories($scope, 'categories'), tmPromise = dataLoad.loadTransportationMode($scope, 'tModes'), tourPromise = dataLoad.loadAdventures($scope, 'tours'); categoryPromise.then(function() { console.log('data

How to apply a partial update to an object using AngularFire

爱⌒轻易说出口 提交于 2019-12-10 22:02:32
问题 The $save() in Angularfire 0.8 is confusing me. Here's a minimal example - a snippet from my controllers.js file: .controller('LandingPageController', ['$scope','$firebase', function($scope,$firebase) { $scope.addNode = function() { var FB = new Firebase('https://protodb.firebaseio.com/testrecords/'); var fbr = $firebase(FB); fbr.$set(1,{firstname: 'James'}); } $scope.addAttribute = function() { var FB = new Firebase('https://protodb.firebaseio.com/testrecords/1'); var fbr = $firebase(FB).

$on loaded fires once for new references AngularFire 0.5.0

隐身守侯 提交于 2019-12-10 20:54:12
问题 Let's say were using pushState to navigate routes: $locationProvider.html5Mode(true); And there are two routes with two different controllers: $stateProvider.state('one', { url:'/one', templateUrl:'one.html', controller: 'oneCtrl' }); $stateProvider.state('two', { url:'/two', templateUrl:'two.html', controller: 'twoCtrl' }); oneCtrl creates a new reference to the same resource as twoCtrl : .controller('oneCtrl', ["$scope", "$firebase", function($scope, $firebase) { var oneRef = new Firebase(

Firebase: Local Development and testing in AngularFire

ぃ、小莉子 提交于 2019-12-10 19:48:08
问题 I am using Angularfire to make a website. I am trying to integrate oauth based sign in with google for user authentication but when I try to run index.html file and try to login following error is displayed 11:59:28.189 Error: There are no login transports available for the requested method. Stack trace: Mg@file:///G:/Project/root/js/firebase.js:142:1267 dh/<@file:///G:/Project/root/js/firebase.js:163:141 1 app.js:31:4 I searched on stackoverflow for this and got this answer , it says that I

Property 'downloadURL' does not exist on type 'AngularFireUploadTask'

倾然丶 夕夏残阳落幕 提交于 2019-12-10 14:02:24
问题 I have a problem with the line this.downloadURL = task.downloadURL() with AngularFireUploadTask even though I imported it. import { Component, OnInit } from '@angular/core'; import { AuthService } from '../../core/auth.service'; import { AngularFireStorage, AngularFireStorageReference, AngularFireUploadTask } from 'angularfire2/storage'; import { PostService } from '../post.service'; import { Observable } from 'rxjs/Observable'; @Component({ selector: 'app-post-dashboard', templateUrl: '.

AngularFire2 Child_added event return all data again

南楼画角 提交于 2019-12-10 13:01:59
问题 Is the child_added event in angularfire is different in child_added on firebase? why angularfire return all list including value after child_added while in firebase it only return la this.userList = this.room.getAllUser(); this.userList.snapshotChanges() .subscribe(actions => { console.log(actions); actions.forEach(action => { console.log(action.type); console.log(action.key); console.log(action.payload.val()); }) Do I need to scan again the response and compare the key if in array ? before