Files
brewman/brewman/static/scripts/balance-sheet.js
T
Amritanshu d1a4fc1164 Updated: Angularjs to v1.2.0 final.
Updated: Loading-bar to v0.0.5
Updated: Using the $promise of function to return promises instead of $q and callback function.
2013-11-12 00:29:23 +05:30

24 lines
767 B
JavaScript

'use strict';
var BalanceSheetCtrl = ['$scope', '$location', 'dateFilter', 'info', function ($scope, $location, dateFilter, info) {
$scope.info = info;
$scope.show = function () {
if (angular.isDate($scope.info.Date)) {
$scope.info.Date = dateFilter($scope.info.Date, 'dd-MMM-yyyy');
}
$location.path('/BalanceSheet/' + $scope.info.Date);
};
$('#txtStartDate').focus();
}];
BalanceSheetCtrl.resolve = {
info: ['$route', 'BalanceSheet', function ($route, BalanceSheet) {
var date = $route.current.params.date;
if (typeof date === 'undefined') {
return BalanceSheet.get({}).$promise;
} else {
return BalanceSheet.get({date:date}).$promise;
}
}]
};