JSFiddle - React, Tailwind, and code Playground
HTML
<body ng-app='app'>
<h1>Github Users</h1>
search:<input type="text" ng-model='name'>
<ul ng-controller='GithubCtrl'>
<li ng-repeat='user in users'>
<a href='https://github.com/{{user.login}}'>
{{user.login}}
</a>
</li>
</ul>
</body>
JavaScript
angular.module('app', ['ctrl']);
angular.module('ctrl', ['svc']);
angular.module('svc', []);
angular.module('ctrl')
.controller('GithubCtrl', function ($scope, GithubSvc) {
GithubSvc.fetchStories().success(function (users) {
$scope.users = users;
});
});
angular.module('svc')
.factory('GithubSvc', function ($http) {
return {
fetchStories: function () {
return $http.get('https://api.github.com/users');
}
};
});