Initial version of the angular app.

This commit is contained in:
yackob03 2013-09-24 18:21:14 -04:00
parent e107d79612
commit 995ad8b679
7 changed files with 90 additions and 10 deletions

10
static/js/app.js Normal file
View file

@ -0,0 +1,10 @@
angular.module('quay', ['restangular']).
config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/repository/', {templateUrl: '/static/partials/repo-list.html', controller: RepoListCtrl}).
when('/', {templateUrl: '/static/partials/landing.html', controller: LandingCtrl}).
otherwise({redirectTo: '/'});
}]).
config(function(RestangularProvider) {
RestangularProvider.setBaseUrl('/api/');
});

10
static/js/controllers.js Normal file
View file

@ -0,0 +1,10 @@
function RepoListCtrl($scope, Restangular) {
var repositoryFetch = Restangular.all('repository/');
repositoryFetch.getList().then(function(resp) {
$scope.repositories = resp.repositories;
});
}
function LandingCtrl($scope) {
}