should be something like:
getVars.get().then(function(data){
console.log(data.languages);
});
any ajax calls are asynchronous.
On Saturday, January 11, 2014 9:03:35 PM UTC-8, Александр Духновский wrote:
>
> My code:
>
> .factory('getVars', ['$resource', function($resource) {
> return $resource('puth.com/vars');
> }])
>
> .controller('ctrl', ['$scope', '$http', 'getVars', function ($scope,
> $http, getVars) {
> var vars = getVars.get();
> console.log(vars.languages);
> }]);
>
> As a result of getting undefined. I know that this is due to the response
> delay. But I can not solve this problem. Help me please.
>
--
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/groups/opt_out.