I have an issue where I can't retrieve a number value from a $firebaseObject
in AngularFire.
if I console.log($scope.slideGen)
the value correctly shows up in the log output of the entire object, but if I
console.log($scope.slideGen.time)
then I get undefined
.
Got the following code in a controller
Auth.$onAuth(function(authData) {
$scope.userKey = authData.uid;
$scope.ref = Ref.child('users').child($scope.userKey);
loadSlide();
});
function loadSlide() {
if ($scope.slideKey !== '') {
$scope.slide = $firebaseObject($scope.ref.child('slides').child($scope.slideKey));
$scope.slideGen = $firebaseObject($scope.ref.child('slidesGeneral').child($scope.slideKey));
$scope.time = new Date(1970, 0, 1, 0, 0, 0).setSeconds($scope.slideGen.time);
console.log('Current time set to: ' + $scope.slideGen.time); //This returns undefined
}
}