Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/318.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs $ionicConfigProvider和缓存视图=";“真的”;不工作1_Angularjs_Ionic Framework - Fatal编程技术网

Angularjs $ionicConfigProvider和缓存视图=";“真的”;不工作1

Angularjs $ionicConfigProvider和缓存视图=";“真的”;不工作1,angularjs,ionic-framework,Angularjs,Ionic Framework,我的屏幕上有三个选项卡,我可以导航到它们: 表1 表2 表3 我正在从restapi安装一些数据,并用一些仪表将其显示在屏幕上。数据已成功加载,但当我导航到任何其他选项卡(Tab2或Tab3)然后返回到Tab1时,我的数据不在那里。我希望Tab1保持一致,我希望它与我在转到任何其他选项卡之前所做的一样 到目前为止,我所做的是: 添加缓存视图=“true”: $stateProvider .state('tab', { url: '/tab', abstract: true, c

我的屏幕上有三个选项卡,我可以导航到它们:

  • 表1
  • 表2
  • 表3
我正在从
restapi
安装一些数据,并用一些仪表将其显示在屏幕上。数据已成功加载,但当我导航到任何其他选项卡(
Tab2
Tab3
)然后返回到
Tab1
时,我的数据不在那里。我希望
Tab1
保持一致,我希望它与我在转到任何其他选项卡之前所做的一样

到目前为止,我所做的是:

  • 添加缓存视图=“true”

    $stateProvider
    .state('tab', {
      url: '/tab',
      abstract: true,
      cache : true,
      templateUrl: 'templates/tabs.html'
    })
    .state('tab.dash', {
      url: '/dash',
      cache : true,
      views: {
        'tab-dash': {
        templateUrl: 'templates/tab-dash.html',
        controller: 'DashCtrl'
      }
    }})
    

  • 添加缓存:true:

    $stateProvider
    .state('tab', {
      url: '/tab',
      abstract: true,
      cache : true,
      templateUrl: 'templates/tabs.html'
    })
    .state('tab.dash', {
      url: '/dash',
      cache : true,
      views: {
        'tab-dash': {
        templateUrl: 'templates/tab-dash.html',
        controller: 'DashCtrl'
      }
    }})
    
  • $ionicConfigProvider来自

但对我来说什么都不管用

PS:我正在使用Ionic1+AngularJS