arnaucube
arnaucube/decentralized-blogging-platformPublic Self-hosted repository
decentralized-blogging-platform/webapp/views/post/post.js
webapp/views/post/post.jsRaw
 1'use strict';
 2
 3angular.module('app.post', ['ngRoute'])
 4
 5    .config(['$routeProvider', function($routeProvider) {
 6        $routeProvider.when('/post', {
 7            templateUrl: 'views/post/post.html',
 8            controller: 'PostCtrl'
 9        });
10    }])
11
12    .controller('PostCtrl', function($scope, $rootScope, $http) {
13
14        /*$http.get(apiurl + 'user/' + )
15            .then(function(data) {
16                console.log('data success');
17                console.log(data);
18                $scope.user = data.data;
19            }, function(data) {
20                console.log('no user');
21            });*/
22            //fake data
23          $scope.user = user;
24          $scope.post = user.posts[0];
25    });