woodpecker/server/app/scripts/controllers/home.js

25 lines
644 B
JavaScript
Raw Normal View History

'use strict';
angular.module('app').controller("HomeController", function($scope, $http, feed) {
feed.subscribe(function(item) {
// todo toast notification
});
2014-09-30 07:43:50 +00:00
$http({method: 'GET', url: '/api/user/feed'}).
success(function(data, status, headers, config) {
2014-07-10 05:24:06 +00:00
$scope.feed = (typeof data==='string')?[]:data;
2014-07-09 07:46:15 +00:00
}).
error(function(data, status, headers, config) {
console.log(data);
});
2014-09-30 07:43:50 +00:00
$http({method: 'GET', url: '/api/user/repos'}).
2014-07-09 07:46:15 +00:00
success(function(data, status, headers, config) {
$scope.repos = (typeof data==='string')?[]:data;
}).
error(function(data, status, headers, config) {
console.log(data);
});
});