Skip to content

Instantly share code, notes, and snippets.

@furenku
Last active January 30, 2016 05:12
Show Gist options
  • Save furenku/10aa080b2db473872121 to your computer and use it in GitHub Desktop.
Save furenku/10aa080b2db473872121 to your computer and use it in GitHub Desktop.
.controller('UsersCtrl',
["$scope", "$state", "$http",function($scope, $state, $http){
$http.get("http://localhost:8000/api/v0/users/", { cache: true })
.success(function(data) {
$scope['users'] = data;
if (data['next']) $scope.nextPage = 2;
});
return $scope;
}])
---
name: users
url: /users
controller: UsersCtrl
---
<div class="grid-content users" ng-show="users">
<div class="grid-content shrink">
<select class="">
<option class="" ng-repeat="user in users" value="{{user.id}}">
<div class="grid-block">{{user.username}}</div>
<div class="grid-block">{{user.name}}</div>
<div class="grid-block">{{user.email}}</div>
</option>
</select>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment