Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass object from one Onsen UI page to another?

Tags:

onsen-ui

I have a js object loaded on one Onsen UI masterpage, when I called ons.navigator.pushPage('child_page.html') how can I get the js object on the child page?

like image 614
Eli Avatar asked Dec 01 '25 03:12

Eli


1 Answers

See the documentation and guides.

http://onsenui.io/guide/overview.html#PageNavigation

You can get objects via the following methods:

page1

myNavigator.pushPage("page2.html", { param1: "value1", param2: "value2" });

page2

var page = myNavigator.getCurrentPage();
console.log(page.options.param1); // Will return "value1"    
like image 154
Ataru Avatar answered Dec 03 '25 07:12

Ataru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!