angularfire

How to pull key name from array of objects in AngularFire

痴心易碎 提交于 2019-12-12 06:04:51
问题 Can someone help me pull the unique object name from contents ($Id). I'm able to loop over $scope.data in my template with ng-repeat but I can't get the name of that array. Need this to build a URL reference. In short, how do I get "2015-02-27T20:24:11-06:00"? I can pull out item.count, item.handle, item.img_url, but {{item.$id}} doesn't work. obj.$asArray(); obj.$asObject(); 回答1: If you fetch the data $asArray() and save it on $scope.data you should simply be able to get the $id as you

Firebase auth rules working for facebook provider but not email/pwd

半城伤御伤魂 提交于 2019-12-12 05:38:04
问题 I am trying to write some rules on my DB that prevent the user from writing unless they are authenticated with a provider other than 'anonymous'. This is the rule that I have but for some reason it works when im logged in with facebook but not with email/password; I get a permission denied error. PS the email/pwd user was created before the upgraded SDK. Any thoughts why this is not working? "updates": { ".read": "auth !== null", ".write": "auth !== null && auth.provider !== 'anonymous'", "

Post.delete(post) function not working in revised ThinksterIO Learn to Build Real-Time Web Apps (w/ AngularJS & Firebase) tutorial

*爱你&永不变心* 提交于 2019-12-12 04:57:56
问题 I've been following along with the recently revised Thinkster.io AngularJS Tutorial: Learn to Build Real-Time Web Apps but I get stuck around the 80% mark specifically with the code to delete a post. For some reason I can not delete any posts I've created with the following delete funciton the tutorial provides. delete: function (post) { if (User.signedIn()){ var user = User.getCurrent(); if (user.username === post.owner) { posts.$remove(post).then(function () { User.posts(user.username).

persistent authentication states Firebase

浪尽此生 提交于 2019-12-12 04:18:52
问题 Lets say I've configured my write rules to a specific email : { "rules": { ".read": true, ".write": "auth.email == 'example@example.com'" } } And I login in using the angularFireAuth service: .controller('loginCtrl', ["$scope", "$rootScope", "angularFireAuth", function($scope, $rootScope, angularFireAuth) { var ref = new Firebase("https://test.firebaseio.com/"); angularFireAuth.initialize(ref, {scope: $scope, name: "user"}); $scope.cred = {}; $scope.signin = function() { angularFireAuth.login

AngularFire & Ionic - No data form is transmitted to server

馋奶兔 提交于 2019-12-12 04:05:25
问题 I use Ionic and AngularFire for make my app, but I have a (new) problem: My data form are empty ! We can see just the fiels in my DataBase Firebase. How do I do to retrieve the form data entered by the user in the Firebase database? The issue in image : http://img15.hostingpics.net/pics/238594event.png This is my HTML : <form ng-submit="submitEvent(event)"> <label class="item item-input item-stacked-label"> <span class="input-label"><i class="fa fa-pencil"></i> Nom de l'événement</span>

How to Catch Error When Data is not Sent on Angularfire when adding data to firebase?

风格不统一 提交于 2019-12-12 03:49:19
问题 Im using angularfire to save data into my firebase. Here is a quick code. $scope.users.$add({ Name:$scope.username, Age:$scope.newage, Contact: $scope.newcontact, }); alert('Saved to firebase'); I am successful in sending these data to my firebase however how can I catch an error if these data are not saved successfully? Any ideas? EDIT So after implementing then() function. $scope.users.$add({ Name:'Frank', Age:'20', Contact: $scope.newcontact, }).then(function(ref) { alert('Saved.'); })

Firebase range query

会有一股神秘感。 提交于 2019-12-12 03:48:29
问题 Im using AngularFire+Firebase and have data at firebase-database . Im trying to paginate Data with Smart Table My problem is that I dont know how to range query without specifying any child i,e fetch records from record # 25 to 35 Below query gives me first 5 records var queryFIrst = visitRef.startAt().limitToFirst(5); $scope.Visits = $firebaseArray(queryFIrst); now Im trying to get records next 5,from 6 to 10 and I tried below var queryFIrst = visitRef.startAt().limitToFirst(5).endAt()

Angularfire 2 Error: The specified authentication provider is not enabled for this Firebase

大憨熊 提交于 2019-12-12 03:36:28
问题 I am creating a simple sample auth app with Ionic 2 and angularfire 2 as backend, when i try to create new user it says: EXCEPTION: Error: Uncaught (in promise): Error: The specified authentication provider is not enabled for this Firebase. But i already enabled firebase authentication in firebase console: app.ts import {App, Platform} from 'ionic-angular'; import {StatusBar} from 'ionic-native'; import {HomePage} from './pages/home/home'; import { FIREBASE_PROVIDERS, defaultFirebase,

Firebase Error - “FireBase is not defined”

一曲冷凌霜 提交于 2019-12-12 03:28:11
问题 I am trying to utilize angularFire in my app, I followed this guide (https://www.firebase.com/tutorial/#tutorial/angular/0), and I even tried generator-angularfire, however both times, initially I get : - angular.js:12330 ReferenceError: FireBase is not defined I'm using this code in my AngularJS App.js : var macApp = angular.module('macApp', ['firebase']); macApp.controller('ProdutosCtrl', ['$scope', '$firebaseArray', function ($scope, $firebaseArray) { var meusProdutos = new FireBase("https

How to input a time into firebase with AngularFire?

别来无恙 提交于 2019-12-12 03:17:16
问题 I'd like a user to be able to submit a time into the firebase database by selecting a time from the input box. I know how to have the user enter text into firebase based on the firebase documentation, but not how the user can enter in a time into firebase. When I add "type="time"' to the input box (as below), the below code can no longer submit input to firebase. When it's removed, it goes back to normal. HTML <html ng-app="sampleApp"> <head> <script src="https://ajax.googleapis.com/ajax/libs