angularfire

What is the correct architectural pattern for cross domain REST call in AngularJS?

我的梦境 提交于 2019-12-07 06:40:10
问题 I've created an AngularJS service that is hitting the Salesforce REST API directly from the client. However, I haven't been able to get it working due to same origin restrictions. Even when accessing non authenticated REST services and trying both $http, $http.json and Ajax. I've also tried lots of combinations of Json, Jsonp etc. Given that I've had so many issues I'm thinking that my general approach is incorrect. Perhaps I need to setup a proxy server for this? My backend is Firebase so I

Firebase 3-way data binding with ControllerAs syntax

喜欢而已 提交于 2019-12-07 05:08:33
问题 I'm tring to get 3-way data binding with firebase and angularfire. You can see what I've got in Plunker: http://plnkr.co/edit/RGA4jZK3Y6n4RkPCHK37 app.js : angular.module('ideaBattle', ["firebase"]); services : angular .module('ideaBattle') .constant('FBURL', 'https://ideabattle.firebaseio.com/') .service('Ref', ['FBURL', Firebase]) .factory('dataBank', function(Ref, $firebase) { return $firebase(Ref).$asArray(); }); controller : angular .module('ideaBattle') .controller('ideaListCtrl',

Uncaught Error: A network error

狂风中的少年 提交于 2019-12-07 04:45:13
问题 after I've tried to use the firebase authentication service, I got an uncaught error: a network error (such as timeout, interrupted connection or unreachable host) has occurred I have tried to whitelist all related domain-names: <allow-intent href="*.firebaseio.com" /> <allow-intent href="*.firebaseapp.com" /> <allow-intent href="*.google.com" /> <allow-intent href="*.googleapis.com" /> <allow-intent href="*.cloudflare.com" /> <allow-intent href="auth.firebase.com" /> <access origin="*" />

createUser and login flow with promises

老子叫甜甜 提交于 2019-12-06 15:03:31
In this git issue AngularFire disabled the auto-login functionality associated with $createUser . ( The docs are outdated.) So what's the best practice / cleanest way to create a user and then log them in? app.factory('Auth', function($firebaseSimpleLogin, FIREBASE_URL, $rootScope) { var ref = new Firebase(FIREBASE_URL); var auth = $firebaseSimpleLogin(ref); var Auth = { register: function (user) { return auth.$createUser(user.email, user.password); }, login: function (user) { return auth.$login('password', user); }, ... Note: $createUser returns a md5 hash but $login uses plaintext password.

$firebaseSimpleLogin and session without re-login

扶醉桌前 提交于 2019-12-06 14:18:22
I am using $firebaseSimpleLogin to log into Firebase using email/password. It is working rather well when I log in using email/password, I could see sessionkey being saved automatically as a cookie. However, would like to remember the log in such that user only have to log in once. So I included {rememberMe: true} during auth. How do I check if the session is still alive at the beginning of the page being loaded? From your question, I assume you're using Angular JS. You can execute a run block on your main module, which is run everytime the page is loaded. I don't know much about Angularfire,

Firebase newest feed for following users

陌路散爱 提交于 2019-12-06 12:58:57
问题 I'm working with Angularjs and Firebase. Right now I'm new at firebase for this I'm struggling to find solutions for my issues. Imagine I'm sorting users like this users:{ facebook:123456789:{ blog: [{ // List of blogs }], following: [{ // List of users auth.ids }] }, facebook:123456780:{ blog: [{ // List of blogs }], following: [{ // List of users auth.ids }] } } And getting logged in user blog object and iterating and pushing it to the array like this var blogRef = new Firebase(FirebaseUrl

Uploading video to Firebase uing ngCordova ($cordovaCapture) in ionic framework

巧了我就是萌 提交于 2019-12-06 11:50:18
问题 How to upload video that I record using my mobile. I manage to upload the video path to Firebase but when I want to use it in my view (html file), it does not work. Here is my code: .controller("HomeCtrl", function($scope, $firebaseArray, $cordovaCamera, $location, $cordovaCapture){ var fb = new Firebase("https://myURL.firebaseio.com/videos"); $scope.videos; $scope.record = function(){ fb = new Firebase("https://myURL.firebaseio.com/videos"); $scope.videos = $firebaseArray(fb); var options =

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

南楼画角 提交于 2019-12-06 11:20:07
问题 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

$authWithPassword is not a function in AngularFire 2.x

ぃ、小莉子 提交于 2019-12-06 10:39:32
I've seen posts about this problem before, but they're either outdated or offer a solution very similar to my setup. Basically, I have two functions in my controller: authCtrl.login and authCtrl.register. The register's call to Auth.$createUserWithEmailAndPassword() works fine, but the login's call to Auth.$authWithPassword() does not, as I'm getting a "..is not a function" error. Can't for the life of me figure out what is wrong here. Here's my setup: auth.service.js: angular.module('angularfireSlackApp') .factory('Auth', function($firebaseAuth, $firebaseObject){ var auth = $firebaseAuth();

Angularfire login with Facebook not recieving extended permissions

故事扮演 提交于 2019-12-06 08:34:32
I had this working perfectly before upgrading to angularfire 0.9 I want to request the user's email address from facebook . Facebook has already granted me permission to ask for this from my users. I am using the code below to login with facebook. It all works perfectly accept that it doesn't request the user's email. FYI: I am using the Angularfire-seed codebase loginWithFacebook: function() { return auth.$authWithOAuthPopup("facebook", function(error, authData) { /* Your Code */ }, { remember: "sessionOnly", scope: "email, user_likes" }); }, thanks in advance! In response to Mike's answer