Toggle save value using localstorage


I’m trying to save the state of a toggle (whether it’s toggled or not) using localstorage, but it’s not saving or showing the saved value;

My code is:

<li class="item item-toggle">
                    <label class="toggle toggle-positive">
                        <input ng-model="loonheffing" 

                        <div class="track">
                            <div class="handle"></div>


$scope.setLoonheffing = function (value) {
        window.localStorage['loonheffing'] = value;
$scope.loonheffing = window.localStorage['loonheffing'] || true;


You might have found the same problem I did. There was an update to the chrome web view that borked local storage. See link:


You’re right, it’s the browser. I tested it on my phone and it worked perfectly fine.