Initial commit

This commit is contained in:
jendib
2013-07-27 18:33:20 +02:00
parent 41cb6dd9ae
commit 9b74bd8194
156 changed files with 72879 additions and 0 deletions
@@ -0,0 +1,34 @@
'use strict';
/**
* Document controller.
*/
App.controller('Document', function($scope, $state, Restangular) {
/**
* Load documents.
*/
$scope.loadDocuments = function() {
Restangular.one('document')
.getList('list', {
offset: 0,
limit: 30
})
.then(function(data) {
$scope.documents = data.documents;
});
};
/**
* Go to add document form.
*/
$scope.addDocument = function() {
$state.transitionTo('document.add');
};
$scope.viewDocument = function(id) {
$state.transitionTo('document.view', { id: id });
};
// Initial documents loading
$scope.loadDocuments();
});