Reputation: 36659
I am currently using
syncObject.$bindTo($scope, 'data').then(function(){
$scope.dataLoaded = true;
});
to check when data sync with Firebase is completed.
After reading the documentation, I see that
syncObject.$loaded(
$scope.dataLoaded = true;
);
does something similar.
Is there a difference between the two methods?
Upvotes: 0
Views: 737
Reputation: 36659
The promise on $bindTo
does indeed call $loaded
internally. If you were using $bindTo
, you could use the promise callback to achieve what $loaded
does
Upvotes: 2
Reputation: 2811
Your first code block does "three way binding" and the second does not. Also per the documentation, AngularFire provides a shortcut method for things passed into $FirebaseObject.$loaded()
Upvotes: 1