Search Posts

Category: angular-local-storage

Localstorage is working for first time. If I refresh page at second it is working fine

Am using Angular ng-storage. Am facing an issue with local storage. At first when page is loaded the localstorage is assigning with null value. If I refresh at second time localstorage value is setting fine. I dono what the issue. My code is. var app = angular.module(‘EntityApp’, [‘ngRoute’,’slickCarousel’]); app.controller(‘EntityAppCntroller’, function ($scope, $http, $window) { localStorage.IsNewPinSet = 22; if (localStorage.getItem(‘IsNewPinSet’) != 1) { var getLocation = function() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition); } else { alert(“Geolocation […]