Router Parameters

Hi everyone,

I’m having some trouble trying to use the parameter that are recieved from another Page.

Currently I’m using

router.push("view", {id: 3})

Then after that on the JS on the view Page im recieving it as this.Parameter.

The problem i have is that i have no way to acces the data from js. on the UI its fine. but not from js. if i console.log(this.Parameter.value) its null.

Not sure what i an doing wrong.


Hi Franz,
this.Parameter is a special kind of beast and you shouldn’t really approach it as a regular variable.

Instead of console.logging it directly, you should do this inside of your receiving page JS:

this.Parameter.onValueChanged(module,function(param) {
    console.log('Incoming param changed to: ' + JSON.stringify(param));

Please also note that the value only changes when it changes. Meaning, if you router.goBack() from the receiving page and then open it again with the same parameter, the .onValueChanged will not trigger (since the value didn’t change).