拥有第一视图= index.js第二视图= another.js
全局文件alloy.js
我已经从index.js调用了全局类(index.js)方法,现在我想移到another.js视图,但在httpRequest方法完成后(在alloy.js中声明和实现)。
---alloy.js---
Alloy.Global.httpMethod=function(){
//xml response is achieved, now from here i want to navigate to another.js view
}
---index.js---
Alloy.Global.httpMethod();
---another.js---
//some UI objects.发布于 2014-10-13 03:25:48
您要做的第一件事是创建一个控制器,您的another.js必须是一个controller,它可以通过右键单击应用程序并从那里创建一个新的控制器来创建。
一旦您的控制器创建,您可以很容易地做菲尔在评论中说的话。i.e
Alloy.createController('another').getView().open();
这必须放在HttpClient的onload函数中。
希望能帮上忙。
https://stackoverflow.com/questions/26326341
复制相似问题