1
I am still novice in development using Angularjs and am having problems accessing an API:
.controller('RegulamentoCtrl', function($scope, $state, $http, $ionicPopup, AuthService) {
$http.get('http://rest-service.guides.spring.io/greeting')
.then(function(response) {
alert('teste');
}, function(err) {
alert(err)
});
})
While trying to access this service, which returns me a JSON, I get the following error message:
Error: Unexpected request: GET http://rest-service.guides.spring.io/greeting No more request expected
There’s a mistake there or you’re calling one
alert
inside the other?– Rick Wolff
I need to communicate to an external API. Of course it won’t be this one. But I have to understand why it returns this error. To then test my API. I am researching and seeing something about $httpBackend.whenGET, but this is unfamiliar to me. So I’m running some tests. But so far nothing! :/
– alan
@Rick Wolff This from Alert I had already tidied up here and forgot to correct in question tb. But that’s not the problem!
– alan