i've been trying to not use $scope when returning data from $http.get()
var app = angular.module('myApp',[])
app.controller('OrderCtrl',['$http',function($http){
this.commande = null
this.orders = {
cde : null,
start : '2014-01-01',
end : '2014-01-31',
get : function(){
return $http.get('http://apimucommerce/api/order/'+this.start+'/'+this.end+'/')
.then(function(response){
return response.data})
}
}
this.commande = this.orders.get()
}])
the ajax call is returning datas, but i cannot assign to the this.commande property, what's wrong thanks.