[英]How to pass Data from One Controller to Service and access that data on Other Controller on same event?
[英]how to pass one variable from one controller to other controller in alloy
我的代碼如下。 我想將名為“項目”的控制器的“獲取項目”的值傳遞給名為“項目列表”的其他控制器。 誰能幫助我
function callPopup(e)
{
var itemselect =e.itemIndex;
if(itemselect==1)
{
getitem=items[3].image1;
}
return getitem;
}
您可以按如下所示傳遞參數:
Alloy.createController('other_controller',{getitem:getitem}).getView();
並且在other_controller中,您可以簡單地將其檢索為
args.getitem;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.