-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRepoController.js
More file actions
28 lines (19 loc) · 854 Bytes
/
RepoController.js
File metadata and controls
28 lines (19 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(function() {
var mainApp = angular.module("mainApp");
mainApp.controller("RepoController",
function($scope, github, $routeParams) {
var onError = function(error) {
$scope.error = "There was something error: " + error.statusText
}
var onGetCollaborator = function(data) {
console.log(data.contributions)
$scope.getCollaborator = data.contributors
$scope.openIssues = data.open_issues_count
}
$scope.repository = $routeParams.repository
$scope.username = $routeParams.username
github
.getCollaborator($routeParams.username, $routeParams.repository)
.then(onGetCollaborator, onError)
})
}())