EmployeeAttendance controller and subcontroller minifiable.
This commit is contained in:
parent
b5518a7577
commit
68897338f1
@ -1,6 +1,6 @@
|
||||
CACHE MANIFEST
|
||||
|
||||
# version 2012-12-07.5
|
||||
# version 2012-12-07.6
|
||||
|
||||
CACHE:
|
||||
/partial/404.html
|
||||
|
@ -1,6 +1,6 @@
|
||||
'use strict';
|
||||
|
||||
function EmployeeAttendanceCtrl($scope, $location, $routeParams, EmployeeAttendance, attendance_types, info) {
|
||||
var EmployeeAttendanceCtrl = ['$scope', '$location', '$routeParams', 'EmployeeAttendance', 'attendance_types', 'info', function ($scope, $location, $routeParams, EmployeeAttendance, attendance_types, info) {
|
||||
$scope.attendance_types = attendance_types;
|
||||
$scope.info = info;
|
||||
$scope.show = function () {
|
||||
@ -24,9 +24,9 @@ function EmployeeAttendanceCtrl($scope, $location, $routeParams, EmployeeAttenda
|
||||
});
|
||||
};
|
||||
$('#txtEmployee').focus();
|
||||
}
|
||||
}]
|
||||
|
||||
function EmployeeAttendanceSubCtrl($scope) {
|
||||
var EmployeeAttendanceSubCtrl = ['$scope', function ($scope) {
|
||||
$scope.original = {};
|
||||
angular.copy($scope.item, $scope.original);
|
||||
|
||||
@ -49,9 +49,9 @@ function EmployeeAttendanceSubCtrl($scope) {
|
||||
$scope.isDirty = function(){
|
||||
return !angular.equals($scope.original, $scope.item)
|
||||
}
|
||||
}
|
||||
}]
|
||||
EmployeeAttendanceCtrl.resolve = {
|
||||
info:function ($q, $route, EmployeeAttendance) {
|
||||
info:['$q', '$route', 'EmployeeAttendance', function ($q, $route, EmployeeAttendance) {
|
||||
var deferred = $q.defer();
|
||||
|
||||
var id = $route.current.params.id;
|
||||
@ -67,13 +67,13 @@ EmployeeAttendanceCtrl.resolve = {
|
||||
EmployeeAttendance.get({id:id, StartDate:start_date, FinishDate:finish_date}, successCb);
|
||||
}
|
||||
return deferred.promise;
|
||||
},
|
||||
attendance_types:function ($q, AttendanceTypes) {
|
||||
}],
|
||||
attendance_types:['$q', 'AttendanceTypes', function ($q, AttendanceTypes) {
|
||||
var deferred = $q.defer();
|
||||
var successCb = function (result) {
|
||||
deferred.resolve(result);
|
||||
};
|
||||
AttendanceTypes.query({}, successCb);
|
||||
return deferred.promise;
|
||||
}
|
||||
}]
|
||||
};
|
Loading…
Reference in New Issue
Block a user