Javascript 使用超音速/类固醇,从Modal onHide在开场白页面中获取一些值

Javascript 使用超音速/类固醇,从Modal onHide在开场白页面中获取一些值,javascript,cordova,steroids,supersonic,appgyver,Javascript,Cordova,Steroids,Supersonic,Appgyver,我开始使用超音速/类固醇。我有一个page.html,它使用 <super-modal-show location=“modal.html”>click me</super-modal-show> 当模式关闭时,我需要返回一些值,并在开始页中获取这些值 你知道我该怎么做吗 提前感谢。有几种方法可以做到这一点 您可以在此处签出超级作用域选项: 这样可以跨视图绑定数据。从文档中: // In your main view controller angular .mo

我开始使用超音速/类固醇。我有一个page.html,它使用

<super-modal-show location=“modal.html”>click me</super-modal-show>
当模式关闭时,我需要返回一些值,并在开始页中获取这些值

你知道我该怎么做吗


提前感谢。

有几种方法可以做到这一点

您可以在此处签出超级作用域选项: 这样可以跨视图绑定数据。从文档中:

// In your main view controller
angular
    .module('first')
    .controller('FirstController', function($scope, supersonic) {
        // initialize the variable in local scope
        $scope.message = null;

        // bind it to superscope
        supersonic.bind($scope, "message");
});

// And in your modal view controller

angular
    .module('second')
    .controller('SecondController', function($scope, supersonic) {
        $scope.message = null;
        supersonic.bind($scope, "message");
});
还有消息传递功能,您可以跨通道发布消息,并订阅不同控制器中的通道

如果您对本地存储比较满意,还可以使用本地存储。我建议为本地存储对象命名空间,以防手机上的其他应用程序使用相同的对象名称,因为它将被共享


查看这些文档,您将找到多种方法来完成您需要的任务

多谢各位!我用postMessage解决了这个问题,就像你在第二个例子中说的,因为我还不习惯使用angular。