ionic+angular 做混合app 用localStorage存储数据 刷新多次会丢失数据

angular.module('app.controllers').controller('YuejuanController', YuejuanController);

/**@ngInject**/
function YuejuanController($scope, $ionicPopup, $ionicLoading, $timeout, $state, SubjectAPI, PaperAPI ,$ionicScrollDelegate) {
    $scope.myHandle = $ionicScrollDelegate.$getByHandle('myscroll');
    $scope.yjfs = localStorage.yjfs;


    $scope.subject = localStorage.subject;
    $scope.topicItem = localStorage.topicItem;
    $scope.teaCode = localStorage.teaCode;

})

 

奇葩的是多次刷新后就消失了,就这个问题google了一圈也没找到原因。

你可能感兴趣的:(y)