haakon319 haakon319 - 1 year ago 46
AngularJS Question

I have a theme node in my response object, why can't I access it?

I'm calling a local service that calls a remote service and returns an object like this back:

enter image description here

but If I try to set my scope variable to it, it keeps saying undefined? Here are the two different ways I've tried.

themefactory.then(function (data) {
$scope.themeObject = data.theme;
$scope.themeObj = angular.fromJson(data.theme);

What am I doing wrong?

Answer Source
themefactory.then(function (data) {
      $scope.themeObject = data.Data.theme;