Add initial addons view
This commit is contained in:
17
src/views/addons.js
Normal file
17
src/views/addons.js
Normal file
@@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
angular.module('Application').controller('AddonsController', ['$scope', '$location', 'Client', function ($scope, $location, Client) {
|
||||
Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); });
|
||||
|
||||
$scope.ready = false;
|
||||
$scope.addons = [];
|
||||
|
||||
Client.onReady(function () {
|
||||
Client.getAddons(function (error, result) {
|
||||
if (error) return Client.error(error);
|
||||
|
||||
$scope.addons = result.map(function (a) { return { name: a }; });
|
||||
$scope.ready = true;
|
||||
});
|
||||
});
|
||||
}]);
|
||||
Reference in New Issue
Block a user