+ timeline
This commit is contained in:
1 parent
0d6cf42c7f
commit
37d22b63ad
11 files changed
+183
-60
No files matched your search
@@ -41,6 +41,7 @@ app.config(function ($locationProvider, $routeProvider) {
|
||||
|
||||
require("./api/api")(app);
|
||||
require("./ui/menu")(app);
|
||||
require("./ui/timeline")(app);
|
||||
require("./filters/uppercase-first")(app);
|
||||
require("./pages/home")(app);
|
||||
require("./pages/schedule")(app);
|
||||
|
||||
@@ -6,20 +6,4 @@ module.exports = function (app) {
|
||||
app.controller("HomePageController", function ($scope) {
|
||||
$scope.pageClass = "page-home";
|
||||
});
|
||||
|
||||
app.controller("FeedController", function ($scope, api) {
|
||||
api.feed.post()
|
||||
.success(function (list) {
|
||||
$scope.feed = list.map(function (post) {
|
||||
return {
|
||||
date: post.publishDate,
|
||||
image: post.data.images.standard_resolution.url,
|
||||
url: post.data.link,
|
||||
username: post.data.user.username,
|
||||
userpic: post.data.user.profile_picture,
|
||||
text: post.data.caption.text
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Created by tmshv on 23/11/14.
|
||||
*/
|
||||
|
||||
module.exports = function(app) {
|
||||
app.directive("timeline", function () {
|
||||
return {
|
||||
templateUrl: "/views/timeline.html",
|
||||
scope: {
|
||||
|
||||
},
|
||||
link: function(scope, element, attrs){
|
||||
scope.isEven = function(index){
|
||||
return index % 2 === 1;
|
||||
}
|
||||
},
|
||||
controller: function($scope, api){
|
||||
api.feed.post()
|
||||
.success(function (list) {
|
||||
$scope.feed = list.map(function (post) {
|
||||
return {
|
||||
date: post.publishDate,
|
||||
image: post.data.images.standard_resolution.url,
|
||||
url: post.data.link,
|
||||
username: post.data.user.username,
|
||||
userpic: post.data.user.profile_picture,
|
||||
text: post.data.caption.text
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
});
|
||||
};
|
||||
Reference in new issue
Block a user