Skip to content

Commit 83c5049

Browse files
committed
additions on public..
1 parent 9af2ed5 commit 83c5049

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

src/Darryldecode/Backend/Public/backend/cb/app/app.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ angular.module('cb',[
2828
'cb.content',
2929
'cb.customFields',
3030
'cb.mediaManager',
31-
'cb.navigation'
31+
'cb.navigation',
32+
'cb.dashboard'
3233
])
3334

35+
.constant('GITHUB_API', 'https://api.github.com/repos/darryldecode/laravelbackend')
3436
.constant('ADMIN_URL', ADMIN_URL)
3537
.constant('BASE_URL', BASE_URL)
3638
.constant('STORAGE_URL', STORAGE_URL)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
angular.module('cb.dashboard').controller('DashboardInfoController', ['$scope','$window','$timeout','DashboardFactory','AlertService', function ($scope,$window,$timeout,DashboardFactory,AlertService) {
2+
3+
console.log('DashboardInfoController Init');
4+
5+
$scope.releases = [];
6+
7+
DashboardFactory.getReleases().then(function(success) {
8+
console.log(success);
9+
}, function(error) {
10+
console.log(error);
11+
});
12+
}]);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
angular.module('cb.dashboard',[]);
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
angular.module('cb.dashboard').factory('DashboardFactory',['$http','GITHUB_API', function ($http, GITHUB_API) {
2+
3+
/**
4+
* get users
5+
*
6+
* @param params
7+
* @returns {*}
8+
*/
9+
this.getReleases = function () {
10+
11+
// we need to remove this so because we are not calling ajax on our
12+
// own application and GitHub denies this.
13+
delete $http.defaults.headers.common['X-CSRF-TOKEN'];
14+
15+
return $http({
16+
url: GITHUB_API+'/releases',
17+
method: 'GET'
18+
});
19+
};
20+
21+
return this;
22+
}]);

0 commit comments

Comments
 (0)