I'am not able to find the mistake. my php file returning data like ["9963648941","7416527247"], and i'am using angular factory to get the data using http call as below
app.factory("States", function ($http){
var mData = {
getStates: function(){
return $http.get('php/usersList.php')
}
};
return mData;
});
The States factory is using in the controller as follows
app.controller('orderFormController', function($scope,$location,$rootScope,$http,States)
{
States.getStates.then(function(response){
console.log(JOSN.parse(response.data));
})
});
Finally i'am getting error as States.getStates.then is not a function in the controller.
response.dataproperty. You do not need to do it again