The $href action was one way street. You open a new view using the $href action but once you do so, there was no way to get a response back from the next view
In order to return a value from an $href transition, you close the view using the $ok action.
The $ok is similar to $back in that it goes one step back regardless of whether it was opened modally or as a push transition (in case of iOS).
However the $ok can return a value to the parent view using its options. In order to make the previous example to work, the second view should return its control back to the first view using the following code:
How it used to work
The
$href
action was one way street. You open a new view using the $href action but once you do so, there was no way to get a response back from the next viewHow it works now
Now the
$href
action supportssuccess
callback.In order to return a value from an
$href
transition, you close the view using the$ok
action.The
$ok
is similar to$back
in that it goes one step back regardless of whether it was opened modally or as a push transition (in case of iOS).However the
$ok
can return a value to the parent view using itsoptions
. In order to make the previous example to work, the second view should return its control back to the first view using the following code: