mirror of
https://git.victorphan.net/basketballcantho/Teedy_custom.git
synced 2026-08-05 14:03:10 +07:00
Initial commit
This commit is contained in:
@@ -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();
|
||||
});
|
||||
Reference in New Issue
Block a user