Hello, i just want to know how to parse nested json since angular 
controller instead of parse in the table with ng-repeat

Thanks !

Example:


app.factory('JsonSvc', function ($http, $rootScope) {
        return {
            read: function (jsonURL, scope) {
                $http.get(jsonURL).success(function (data, status) {
                    scope.data = data;
                   $rootScope.$broadcast("jsonDone");
                });
            }
        };
    });


//My problem is that it doesn`t $scope.data.alzas.values.grph
//why?

JsonSvc.read('js/defaultFile.json', $scope);
    
    $scope.$on("jsonDone", function () {
        $scope.nestedObj = $scope.data.alzas.values.grph
        //.data.alzas.values.grph;
        $scope.getLen = function () {
            return $scope.data.alzas.values.grph.length;
        };
        
        console.log('hola:' + $scope.nestedObj);
    });

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to