I am a beginner in angular and I want to retrieve the http get response of an url (http://myurl.com) to make after some manipulations.
I test that but no result :/
var app = angular.module('plunker', []);
app.factory('myService', function($http) {
return {
async: function() {
return $http.get('http://apibuilder-apidiscovery.kermit.rd.francetelecom.fr/infrastructures/16857');
}
};
});
app.controller('MainCtrl', function( myService,$scope) {
myService.async().then(function(d) { //2. so you can use .then()
$scope.data = d;
});
});
HTML
<body>
<div ng-controller="MainCtrl">
Data: {{data}}<br>
</div>
</body>
Thank you so much.