SApp.factory('commonservice', function ($http) { var loginuserDetails = {} ; var addItemFunction = function(item) { loginuserDetails = item; }; var getListFunction = function() { return loginuserDetails; }; return { post: function (dataObj, serviceMethod) { return $http.post(serviceUrl + '/' + serviceMethod, dataObj); }, addItem: addItemFunction, getList: getListFunction } }); commonservice.addItem($scope.LoginDetailsModel);when accessing it $scope.LoginDetailsModel = commonservice.getList();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)