Hi,
I’m trying to figure out how to pass a parameter to another page. As far as I understood any object can be passed through. So if i have a router with 2 pages PageA and PageB, and want to send a simple Observable from one to the other. I do:
<Page ux:Class="PageA">
<Router ux:Dependency="router" />
<JavaScript>
var Observable = require("FuseJS/Observable");
var my_param = new Observable("hey");
module.exports = {
input: my_param,
go_to : function() {
router.push("PageB", my_param)
}
}
</JavaScript>
<StackPanel>
<TextInput Value="{input}" />
<Button Clicked="{go_to}" Text="go"/>
</StackPanel>
</Page>
and
<Page ux:Class="PageB">
<Router ux:Dependency="router" />
<JavaScript>
var Observable = require("FuseJS/Observable");
var p = this.Parameter.map(function(param) {
console.log("\npage B")
console.dir(param._values[0]);
console.dir(param.value);
return "...";
});
module.exports = {
go_to : function() {
router.goBack()
},
p
}
</JavaScript>
<StackPanel>
<Button Clicked="{go_to}" Text="go back"/>
</StackPanel>
</Page>
However, as you can see in this.Parameter.map
, value
is null and _values[0]
contains the right value…
Anyone has an idea how to fix this in a not too verbose way/what did I messed up please?
Thanks!