AngularJS Services
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"></script> </head> <body> <script> var app = angular.module("myApp", []); app.controller("myCtrl", function($scope, $http) { $http.get("https://example.com/api/users").then(function(response) { $scope.users = response.data; }); }); </script> </body> </html>