upload thumb image of the article, some stuff fixed

This commit is contained in:
arnaucode
2018-02-03 18:42:27 +01:00
parent 0c1c193645
commit f917eedace
10 changed files with 159 additions and 85 deletions

View File

@@ -1,7 +1,7 @@
<div class="container">
<div class="row">
<div class="col-sm-4">
<div ng-repeat="post in posts" ng-if="$index % 3 == 0">
<div ng-repeat="post in posts | orderBy: '-date'" ng-if="$index % 3 == 0">
<a ng-href="#!/post/{{post.id}}">
<div ng-include="'views/templates/post-thumb-template.html'"></div>
</a>
@@ -9,7 +9,7 @@
</div>
</div>
<div class="col-sm-4">
<div ng-repeat="post in posts" ng-if="$index % 3 == 1">
<div ng-repeat="post in posts | orderBy: '-date'" ng-if="$index % 3 == 1">
<a ng-href="#!/post/{{post.id}}">
<div ng-include="'views/templates/post-thumb-template.html'"></div>
</a>
@@ -17,7 +17,7 @@
</div>
</div>
<div class="col-sm-4">
<div ng-repeat="post in posts" ng-if="$index % 3 == 2">
<div ng-repeat="post in posts | orderBy: '-date'" ng-if="$index % 3 == 2">
<a ng-href="#!/post/{{post.id}}">
<div ng-include="'views/templates/post-thumb-template.html'"></div>
</a>
@@ -25,7 +25,7 @@
</div>
</div>
</div>
<div class="row">
<!--<div class="row">
<div class="col-sm-3">
<div class="card" style="width: 18rem;">
<a ng-href="#!/user">
@@ -38,5 +38,5 @@
</div>
</div>
</div>
</div>
</div>-->
</div>

View File

@@ -12,7 +12,7 @@ angular.module('app.main', ['ngRoute'])
.controller('MainCtrl', function($scope, $rootScope, $http) {
$scope.posts = {};
$scope.posts = [];
$http.get(apiurl + 'posts')
.then(function(data) {
console.log('data success');