AuthenticationService.js 1.75 KB

//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'}

                                    }
                                });
        }
    }
}]);