arnaucube
arnaucube/decentralized-blogging-platformPublic Self-hosted repository
decentralized-blogging-platform/webapp/views/user/user.js
webapp/views/user/user.jsRaw
 1'use strict';
 2
 3angular.module('app.user', ['ngRoute'])
 4
 5    .config(['$routeProvider', function($routeProvider) {
 6        $routeProvider.when('/user', {
 7            templateUrl: 'views/user/user.html',
 8            controller: 'UserCtrl'
 9        });
10    }])
11
12    .controller('UserCtrl', 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 = {
24            username: "mark_zuckerberg",
25            name: "Mark",
26            lastname: "Zuckerberg",
27            description: "Hi all, I'm here to write decentralized blog posts.",
28            twitter: "arnaucode",
29            github: "arnaucode",
30            posts: [
31              {
32                title: "This is the second post",
33                subtitle: "this is the subtitle of the second post",
34                img: "https://cdn-images-1.medium.com/fit/t/800/240/1*4_E6m7J0112DBi1Lmdniiw.png",
35                content: "Some quick example text to build on the card title and make up the bulk of the card's content."
36              },
37              {
38              title: "This is the first post",
39              subtitle: "this is the subtitle of the first post",
40              img: "https://bootstrap-themes.github.io/application/assets/img/unsplash_1.jpg",
41              content: "Some quick example text to build on the card title and make up the bulk of the card's content."
42            }
43            ]
44          };
45          $scope.featured_posts= [
46            {
47              title: "Thinking about python development",
48              subtitle: "this is the subtitle of the second post",
49              img: "https://cdn.static-economist.com/sites/default/files/images/2015/09/blogs/economist-explains/code2.png",
50              content: "Some quick example text to build on the card title and make up the bulk of the card's content."
51            },
52            {
53            title: "Thinking about G",
54            subtitle: "this is the subtitle of the first post",
55            img: "https://cdn-images-1.medium.com/max/1600/1*RNkyx-Zq7w61eR74nMYgnA.jpeg",
56            content: "Some quick example text to build on the card title and make up the bulk of the card's content."
57          }
58          ]
59    });