在不同的视图中更改范围值

Change scope value in a different view

好吧,这几天我一直在努力解决这个问题,但我被困住了。这就是我想要的;我想通过单击按钮在不同的视图中更改我的范围值。因此,如果我在 index.html 视图中并单击一个按钮,我想更改 index2.html 视图上范围的值,然后显示该视图。这是我的代码示例,它不起作用

index.html

<div ng-controller="IndexController">
<button class="button button-block button-assertive" ng-click="checkValues()" value="checkitems" >
  check values
</button>
</div>

IndexController.js

angular
  .module('legeApp')
  .controller('IndexController', function($scope, supersonic, $filter) {  

 $scope.checkValues = function(){   

     $scope.Diagnose = 'test';

        var view = new supersonic.ui.View("legeApp#index2.html");
        var customAnimation = supersonic.ui.animate("flipHorizontalFromLeft");
        supersonic.ui.layers.push(view, { animation: customAnimation });
    };
});

index2.html

<div ng-controller="IndexController">
<div class="card">
  <div class="item item-text-wrap">
    Test<b>{{Diagnose}} </b>
  </div>
</div>
    </div>

我可以在 checkValues 方法之外给出值,但我希望它是两个不同的值,具体取决于您单击的按钮。请帮助

我尝试了建议的代码,但收到错误消息。我做错了什么?

我尝试下面的代码并收到此错误 "SyntaxError: Unexpected token ':' - undefined:undefined"。我也不太明白我想如何以及为什么要在新视图中使用 supersonic.ui.views.params.current 来定位新值。我想在新视图中获取新值,而不是在控制器中?我需要两个不同的控制器吗?我只想在 html 视图中更新我的值,而不是在其中。

supersonic.ui.layers.push: 
( view: view, 
options: { params: {$scope.Diagnose : 'test'} 
animation: customAnimation 
}) => Promise

根据超音速推送 docsparams 属性用于在视图之间传递参数:

JSON string of optional parameters to be passed to the target View, 
accessible via supersonic.ui.views.params.current.

尝试调用

supersonic.ui.layers.push: (
  view: view,
  options: {
    params: {valueToBeSentAccrossView: <Your Value>}
    animation: customAnimation
}) => Promise

然后使用 supersonic.ui.views.params.current 在目标视图中检索值。