AuthenticationService.js
1.75 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
49
50
51
52
53
54
55
//angular
// .module('AIA')
// .factory('AuthenticationService', function ($resource,$http) {
// return{
// authenticateUser: function (userName, Password) {
// alert('called service');
// //return $resource("api/User/:id",
// // { id: 1 },
// // {
// // 'Get': {
// // method: 'GET',
// // url: '/api/User/',
// // //params: { id:1, pageNumber: '@pageNumber', orderBy: '@orderBy' }
// // params: { id: 1 },
// // }
// // });
// }}});
//angular
//.module('AIA')
//.factory('AuthenticationService', ['$resource', function ($resource) {
// debugger;
// return $resource('api/User/:id',
// { id: 42 }, {
// GetUserName: {
// method: 'GET',
// params: { id: 42 },
// isArray: false,
// }
// });
//}]);
angular
.module('AIA')
.factory('AuthenticationService', ['$resource', function ($resource) {
return {
login: function (user) {
alert('called service');
return $resource("http://localhost/AIA/API/Account/:userName,password",
{ userName: 'amrita.vishnoi@ebix.com',password:'education'},
{
'Post': {
method: 'Post',
params: { userName: 'amrita.vishnoi@ebix.com'}
}
});
}
}
}]);