I'm trying to log my service.title
to the console, but it keeps passing it back as a weird object.
.factory('service', function($firebase, FBURL, $routeParams) {
var ref = new Firebase(FBURL + "services/" + $routeParams.serviceId);
var title = $firebase(ref.child('title')).$asObject();
return {
id: $routeParams.serviceId,
title: title
}
})
.controller('ServiceController', function ($scope, $firebase, service, $routeParams, FBURL) {
$scope.service = service;
console.log($scope.service.title);
})
Here's what I get back from the console:
I'm trying to retrieve that
$value
in the console log. Can anyone help explain what I might be doing wrong?
Thanks in advance!