@imbrendino wrote:
Hi,
I'm trying to do external $http requests but the application doesn't find $http although I've imported it.
In a previous version of ionic it works. This is the code:.controller('loginCtrl', ['$scope', '$stateParams',
function ($scope, $stateParams, $ionicPopup,$http, $httpParamSerializerJQLike,$ionicPopup,$ionicHistory, UserService, CONST) {$scope.response;
$scope.showLog= function(){
requestExt();
}function requestExt() {
console.log("login");$http.get(CONST.SERVER_BASE_URL+'/demo/all'). success(function(data, status, headers, config) { console.log("Successo"); }). error(function(data, status, headers, config) { console.log("Errore"); }); }
}])
This is the error:
Error: undefined is not an object (evaluating '$http.get')
The same error occurs when I use $httpParamSerializerJQLike
Posts: 2
Participants: 2