I have created a small project, but I have some problems. I want to run some JavaScript code after my query. My code is like this:
Book.get({
id: $stateParams.id,
min: 0,
max: 3
}).$promise.then(function(data){
vm.list=data;
}).finally(function () {
});
vm.top=vm.list.name;
vm.top is undefined, because the query has not returned yet.
vm.topis undefined because it runs before your callback