Skip to content
This repository has been archived by the owner on Aug 25, 2018. It is now read-only.

Commit

Permalink
update angularFire version
Browse files Browse the repository at this point in the history
  • Loading branch information
katowulf committed Sep 6, 2013
1 parent 9bf5029 commit 0de2f9a
Show file tree
Hide file tree
Showing 4 changed files with 598 additions and 211 deletions.
4 changes: 2 additions & 2 deletions app/js/app.js
Expand Up @@ -27,7 +27,7 @@
});
$routeProvider.otherwise({redirectTo: function() { return isAuthenticated? '/hearth' : '/demo'; }});
}])
.run(['$rootScope', '$location', 'fbUrl', 'angularFireCollection', 'firebaseAuth', '$log', function($rootScope, $location, fbUrl, angularFireCollection, firebaseAuth, $log) {
.run(['$rootScope', '$location', 'fbRef', 'angularFireCollection', 'firebaseAuth', '$log', function($rootScope, $location, fbRef, angularFireCollection, firebaseAuth, $log) {
firebaseAuth();

$rootScope.$log = $log;
Expand All @@ -38,7 +38,7 @@

// use angularFireCollection because this list should be read-only, and it should be filterable
// by using | filter command, which doesn't work with key/value iterators
$rootScope.feedChoices = angularFireCollection(fbUrl('meta'));
$rootScope.feedChoices = angularFireCollection(fbRef('meta'));
$rootScope.redirectPath = null;

$rootScope.$watch('auth.authenticated', function() { isAuthenticated = $rootScope.auth.authenticated; });
Expand Down
10 changes: 5 additions & 5 deletions app/js/services.js
Expand Up @@ -323,8 +323,8 @@
* A change listener that updates the feedManager and articleManager, as well as
* making some minor scope manipulations
*/
appServices.factory('feedChangeApplier', ['$log', 'ArticleManager', 'treeDiff', 'fbUrl', 'angularFire', '$timeout', '$location',
function($log, ArticleManager, treeDiff, fbUrl, angularFire, $timeout, $location) {
appServices.factory('feedChangeApplier', ['$log', 'ArticleManager', 'treeDiff', 'fbRef', 'angularFire', '$timeout', '$location',
function($log, ArticleManager, treeDiff, fbRef, angularFire, $timeout, $location) {
return function($scope, feedManager, provider, userId) {
var articleManager = new ArticleManager(feedManager, $scope);
$scope.feeds = {};
Expand All @@ -351,10 +351,10 @@
$scope.noFeeds = _.isEmpty($scope.feeds);
}

var path = fbUrl('user', provider, userId, 'list');
var userRef = fbRef('user', provider, userId, 'list');
if( userId === 'demo' && provider === 'demo' ) {
// read only
new Firebase(path).once('value', function(ss) {
userRef.once('value', function(ss) {
$timeout(function() {
$scope.feeds = ss.val();
$scope.loading = false;
Expand All @@ -363,7 +363,7 @@
}
else {
// 2-way synchronize of the list of feeds this user has picked
angularFire(path, $scope, 'feeds', {}).then(function() {
angularFire(userRef, $scope, 'feeds').then(function() {
var feed = ($location.search()||{}).feed;
if( feed && !($scope.feeds||{})[feed] ) {
$location.replace();
Expand Down

0 comments on commit 0de2f9a

Please sign in to comment.