My code is as shown below:
angular.module('xyz.homeController', [])
.controller('homeController', ['homeService', '$scope', '$location', '$modal', '$rootScope', '$localstorage', '$window', 'GoogleSignin'
function(homeService, $scope, $location, $modal, $rootScope, $localstorage, $window, GoogleSignin) {
])
angular.module('xyz.homeService', [])
.factory('homeService', function() {
var data = {};
var deliveryOption = 0;
var payCardOption = 0;
var orderId = '';
var restaurentID = '';
var orderInfo = {};
var orderItems = [];
data.setDeliveryOption = function(info) {
this.deliveryOption = info;
};
data.getDeliveryOption = function() {
return this.deliveryOption;
};
data.setOrderId = function(orderId) {
this.orderId = orderId;
};
data.getOrderId = function() {
return this.orderId;
};
data.setRestaurentId = function(id) {
this.restaurentID = id;
};
data.getRestaurentID = function() {
return this.restaurentID;
};
data.setOrderInfo = function(info) {
this.orderInfo = info;
};
data.getOrderInfo = function() {
return this.orderInfo;
};
data.setOrderItems = function(items) {
this.orderItems = items;
};
data.getOrderItems = function() {
return this.orderItems;
};
data.setPayCardOption = function(payCardOption) {
this.payCardOption = payCardOption;
};
data.getPayCardOption = function() {
return this.payCardOption;
};
return data;
});
Now when refresh is pressed , the route is called perfectly, I have handlede the information inside the route perfectly, but somehow I am not able to restore the state of app and as a result of that, I am not able to use homeService
perfectly, how to get the reference of homeService
perfectly, so that I can use it?