2014-06-21 14:22:38 -07:00
|
|
|
'use strict';
|
|
|
|
|
2014-07-13 16:46:49 -07:00
|
|
|
angular.module('app').controller("HomeController", function($scope, $http, feed) {
|
2014-06-21 14:22:38 -07:00
|
|
|
|
2014-06-22 03:02:22 -07:00
|
|
|
feed.subscribe(function(item) {
|
2014-07-13 16:46:49 -07:00
|
|
|
// todo toast notification
|
2014-06-21 17:41:40 -07:00
|
|
|
});
|
|
|
|
|
2014-09-30 00:43:50 -07:00
|
|
|
$http({method: 'GET', url: '/api/user/feed'}).
|
2014-06-21 14:22:38 -07:00
|
|
|
success(function(data, status, headers, config) {
|
2014-07-09 22:24:06 -07:00
|
|
|
$scope.feed = (typeof data==='string')?[]:data;
|
2014-07-09 00:46:15 -07:00
|
|
|
}).
|
|
|
|
error(function(data, status, headers, config) {
|
|
|
|
console.log(data);
|
|
|
|
});
|
|
|
|
|
2014-09-30 00:43:50 -07:00
|
|
|
$http({method: 'GET', url: '/api/user/repos'}).
|
2014-07-09 00:46:15 -07:00
|
|
|
success(function(data, status, headers, config) {
|
|
|
|
$scope.repos = (typeof data==='string')?[]:data;
|
2014-06-21 14:22:38 -07:00
|
|
|
}).
|
|
|
|
error(function(data, status, headers, config) {
|
|
|
|
console.log(data);
|
|
|
|
});
|
|
|
|
});
|