-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path10.filters.js
More file actions
48 lines (43 loc) · 1.25 KB
/
10.filters.js
File metadata and controls
48 lines (43 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
var app = angular.module("app", []);
app.controller("emp", ["$scope", "empService", "empServiceById", "$filter", function($scope, empService, empServiceById, $filter){
$scope.Employee = [];
empService.getEmp(function(result){
$scope.Employee = result;
});
$scope.getEmpDetails = function(){
empServiceById.getEmpById($scope.empSearchNo, function(result){
$scope.empno = result.empno;
$scope.ename = result.ename;
$scope.sal = result.sal;
$scope.deptno = result.deptno;
$scope.hiredate = result.hiredate;
$scope.dob = result.dob;
//$scope.ENAME = $filter("uppercase")(result.ename);
});
};
}]);
app.service("empService", ["$http", "$log", function($http, $log){
this.getEmp = function(cb){
$http({
url: 'http://localhost:3000/allemp/',
method : 'GET'
}).then(function(res){
cb(res.data);
},function(err){
$log.error("Error Occured");
});
};
}]);
app.service("empServiceById", ["$http", "$log", "$filter", function($http, $log, $filter){
this.getEmpById = function(empno, cb){
$http({
url: 'http://localhost:3000/emp?empno=' + empno,
method : 'GET'
}).then(function(res){
//res.data.ename = $filter("uppercase")(res.data.ename);
cb(res.data);
},function(err){
$log.error("Error Occured");
});
};
}]);