Ionic spinners (Animated Loader) getting stuck while localstorage is used
<p>I have implemented <strong>ionic spinners (Animated Loader)</strong> in the application and also I am using <strong>localstorage</strong> to save the data. </p>

<p>When the application communicates with the server ionic spinner works properly, that is it renders smoothly <strong>without getting stuck</strong>. Once the communication with the server is done and the downloaded <strong>data needs to be inserted (saved)</strong> in the localstorage the <strong>spinner gets stuck (does not render properly)</strong>.</p>

<p>In different blogs what I have observed is that localstorage does not render UI properly while data is getting inserted(saved).</p>

<p>Kindly let me know is there <strong>any work around for this problem</strong> or is there any other way of implementing animated loader (Ionic Spinner)</p>

<p>Below is the code that I have implemented</p>

<pre><code>app.factory('LoaderService', ['$ionicLoading', '$timeout', function ($ionicLoading, $timeout) {
    return {
        show: function () {
            var templateVal = "&lt;ion-spinner icon='android'&gt;&lt;/ion-spinner&gt;";
            $ionicLoading.show({
                animation: 'fade-in',
                showBackdrop: true,
                minWidth: 200,
                showDelay: false,
                template: templateVal
            });
        },
        hide: function () {
            $timeout(function () {
                $ionicLoading.hide();
            }, 300);            
        }
    }
}]);
</code></pre>