mirror of
https://github.com/arnaucube/decentralized-blogging-platform.git
synced 2026-02-07 11:26:43 +01:00
GetUsers, GetUser, NewPost, GetPosts, GetPost
This commit is contained in:
28
webapp/views/users/users.html
Normal file
28
webapp/views/users/users.html
Normal file
@@ -0,0 +1,28 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div ng-repeat="user in users" ng-if="$index % 3 == 0">
|
||||
<a ng-href="#!/user/{{user.id}}">
|
||||
<div ng-include="'views/templates/user-thumb-template.html'"></div>
|
||||
</a>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div ng-repeat="user in users" ng-if="$index % 3 == 1">
|
||||
<a ng-href="#!/user/{{user.id}}">
|
||||
<div ng-include="'views/templates/user-thumb-template.html'"></div>
|
||||
</a>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div ng-repeat="user in users" ng-if="$index % 3 == 2">
|
||||
<a ng-href="#!/user/{{user.id}}">
|
||||
<div ng-include="'views/templates/user-thumb-template.html'"></div>
|
||||
</a>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
23
webapp/views/users/users.js
Normal file
23
webapp/views/users/users.js
Normal file
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('app.users', ['ngRoute'])
|
||||
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
$routeProvider.when('/users', {
|
||||
templateUrl: 'views/users/users.html',
|
||||
controller: 'UsersCtrl'
|
||||
});
|
||||
}])
|
||||
|
||||
.controller('UsersCtrl', function($scope, $rootScope, $http) {
|
||||
$scope.users = {};
|
||||
$http.get(apiurl + 'users')
|
||||
.then(function(data) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
$scope.users = data.data;
|
||||
}, function(data) {
|
||||
console.log('no user');
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user