mirror of
https://github.com/arnaucube/decentralized-blogging-platform.git
synced 2026-02-07 11:26:43 +01:00
signup and login working
This commit is contained in:
31
webapp/views/profile/profile.html
Normal file
31
webapp/views/profile/profile.html
Normal file
@@ -0,0 +1,31 @@
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-sm-4">
|
||||
<div ng-include="'views/user_template.html'"></div>
|
||||
</div>
|
||||
<div class="col-sm-8">
|
||||
<div class="card">
|
||||
<table class="table table-striped table-hover ">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Title</th>
|
||||
<th>Description</th>
|
||||
<th>Accuracy</th>
|
||||
<th>Rating</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="model in user.models">
|
||||
<td>1</td>
|
||||
<td>{{model.title}}</td>
|
||||
<td>{{model.description}}</td>
|
||||
<td>{{model.accuracy}}</td>
|
||||
<td>{{model.rating}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
24
webapp/views/profile/profile.js
Normal file
24
webapp/views/profile/profile.js
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('app.profile', ['ngRoute'])
|
||||
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
$routeProvider.when('/profile', {
|
||||
templateUrl: 'views/profile/profile.html',
|
||||
controller: 'ProfileCtrl'
|
||||
});
|
||||
}])
|
||||
|
||||
.controller('ProfileCtrl', function($scope, $rootScope, $http) {
|
||||
|
||||
$http.get(clienturl + 'user')
|
||||
.then(function(data) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
$scope.user = data.data;
|
||||
localStorage.setItem("ai_user", JSON.stringify($scope.user));
|
||||
|
||||
}, function(data) {
|
||||
console.log('no user');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user