localStorage saves, but don't play data in the emulator

I need your help, I can not understand it myself.
I'm developing an application for TVs. To save some input, I use localStorage. I am writing on Java Script using AngularJs.

Running the application in the simulator, localStorage saved the information and, when closing the application and re-entering, the information is reproduced. Everything works perfectly!
The problem is that the same code does not work in the emulator. In localStorage, the information is saved, but when the application (or emulator) is closed and the application is re-entered, there is no information in localStorage, it is empty.
Why can there be?
Can, it is necessary to register any privilege in config.xml? Or do some additional emulator settings?
Html code:

<div id="container5"  data-ng-show="requirePinForCasting" >
  <p id="con10">
    <b>Pin code</b>
  <div class="center">
  <p> <input id="con15" type="text"  maxlength="4" required placeholder="PIN" data-ng-model="pinCode" data-ng-change="pinChange()"></p>

Script code:

        function($scope, $state,) {
          $scope.pinChange = function() {
           localStorage.setItem('pinCode-'+$scope.userId, '' + $scope.pinCode);
          $scope.pinCode = localStorage.getItem('pinCode-'+$scope.userId);
    } ]);