Pulse7
9/8/2017 - 7:06 PM

$http service

(function () {
    let MainController = function ($scope,$http) {
        $http.get("http://api.github.com/users/ab")
            .then(r=>$scope.user=r.data,err=>$scope.error="Something went wrong");
    }

    var app = angular.module("App", []);
    app.controller("MainController", MainController);
})();
=======
<body ng-app="App">
    <div ng-controller="MainController">
        <h1>
        {{error}}
        </h1>
        <h1>
            {{user.name}}
        </h1>
        <img ng-src="{{user.avatar_url}}">