2014-06-21 21:22:38 +00:00
|
|
|
'use strict';
|
|
|
|
|
2014-06-22 09:04:07 +00:00
|
|
|
angular.module('app').controller("HomeController", function($scope, $http, feed, notify) {
|
2014-06-21 21:22:38 +00:00
|
|
|
|
2014-06-22 10:02:22 +00:00
|
|
|
feed.subscribe(function(item) {
|
|
|
|
notify.sendCommit(
|
|
|
|
item.repo,
|
|
|
|
item.commit
|
|
|
|
);
|
2014-06-22 00:41:40 +00:00
|
|
|
});
|
|
|
|
|
2014-06-21 21:22:38 +00:00
|
|
|
$http({method: 'GET', url: '/v1/user/feed'}).
|
|
|
|
success(function(data, status, headers, config) {
|
2014-07-09 07:46:15 +00:00
|
|
|
$scope.feed = (typeof data==='string')?[]:data; //.splice(0, 3);
|
|
|
|
}).
|
|
|
|
error(function(data, status, headers, config) {
|
|
|
|
console.log(data);
|
|
|
|
});
|
|
|
|
|
|
|
|
$http({method: 'GET', url: '/v1/user/repos'}).
|
|
|
|
success(function(data, status, headers, config) {
|
|
|
|
$scope.repos = (typeof data==='string')?[]:data;
|
2014-06-21 21:22:38 +00:00
|
|
|
}).
|
|
|
|
error(function(data, status, headers, config) {
|
|
|
|
console.log(data);
|
|
|
|
});
|
|
|
|
});
|