Can't handle a JSON object properly
<p>I'm doing some tests at Angular.js, and already asked here a few things. Now, I found a strange error I can't find solution for; I hope you can do different!</p>

<p>It's pretty simple: I use this service to retrieve a JSON (haven't tested the test part yet, but the load works perfectly):</p>

<pre><code>svcs.service('dataMod', ['$http', '$q', function($http, $q){

    return{
        manage: manage
    }

    function manage(filename, action, data){
        var defered = $q.defer();
        var promise = defered.promise;

        if(action == "save"){
            $http.post(filename, data).then(function(){
                console.log("Data write success");
            }, function(){
                console.log("Error writing data");
            });
        }else{
            $http.get(filename)
                .success(function(data){
                    defered.resolve(data);
                    console.log("Data resolved");
                    console.log("&gt;&gt; "+JSON.stringify(data.regs));
                })
                .error(function(err){
                    defered.reject(err);
                });
            return promise;
        }
    }
}]);
</code></pre>

<p>I inject it into my controllers' module and use it here:</p>

<pre><code>$scope.data = dataMod.manage("data/registries.json", "load");
</code></pre>

<p>It works because when I check it with a console.log <strong>to the $scope.data variable</strong>, I get this in the browser:</p>

<p><a href="http://i.imgur.com/cfb3O4v.png" rel="nofollow">http://i.imgur.com/cfb3O4v.png</a></p>

<p>So you may be asking... what's the problem? Well, normally I should iterate over this JSON in a way like this: $scope.data.regs[index].object_variable, no? Or just use a ng-repeat in a way like reg in data.regs. But it just won't work.</p>

<p>When I try to do a console.log($scope.data.regs), I get "undefined", and I've been trying various ways to get into the info, but I never can!</p>

<p>What am I doing wrong here?</p>