+ bin, db, insagram, feed on main page

This commit is contained in:
tmshv committed 2014-11-23 21:57:34 +03:00
1 parent 09412f288f
commit 0d6cf42c7f
18 files changed
+449 -17

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
/**
* Created by tmshv on 22/11/14.
*/
module.exports = function(app) {
app.factory("api", function ($http) {
var api = {};
var Endpoint = require("./feed");
api.feed = new Endpoint($http);
return api;
});
};
+13
View File
@@ -0,0 +1,13 @@
/**
* Created by tmshv on 22/11/14.
*/
function APIFeed(http){
this.request = http;
}
APIFeed.prototype.post = function() {
return this.request.get("/api/feed");
};
module.exports = APIFeed;
+2 -4
View File
@@ -39,16 +39,14 @@ app.config(function ($locationProvider, $routeProvider) {
});
});
require("./api/api")(app);
require("./ui/menu")(app);
require("./filters/uppercase-first")(app);
require("./pages/home")(app);
require("./pages/schedule")(app);
require("./pages/team")(app);
require("./pages/docs")(app);
app.controller("HomePageController", function ($scope) {
$scope.pageClass = "page-home";
});
app.controller("SchedulePageController", function ($scope) {
$scope.pageClass = "page-schedule";
});
+25
View File
@@ -0,0 +1,25 @@
/**
* Created by tmshv on 22/11/14.
*/
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
}
});
});
});
};