Hi Constantinescu,
By the time you can access your console, the data will be in. If you put an console.log in the code, you will see it’s not there yet. If you really must do it outside the success method, you can do it like this: $scope.$watch('allRO',function (newdata) { var vectorSource = new ol.source.GeoJSON({ object: $scope.allRO }); }); This accomplish the same thing, but it takes some additional CPU cycles. Regards Sander -- 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 angular+unsubscr...@googlegroups.com. To post to this group, send email to angular@googlegroups.com. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.