Modules and routes

Modules

General rules

  • A module is not aware of other modules

Routes

General rules

  • You route from a screen, and that’s it,
  • Don’t send objects as options / context when you route to another screen (example below),
  • Don’t use RouterManager in screens but method route (example below)

Examples

Object as parameters

Don’t send objects in your routes

WRONG:

let channel = new $Channel();
this.route("fip", { channel : channel }); // WRONG

GOOD:

let channel = new $Channel();
this.route("fip", { channelId : channel.id }); // GOOD

RouterManager

Don’t use RouterManager in screen but method route:

WRONG:

onKeyPressOK: function() {
    return $RouterManager.getInstance().route("screen"); // WRONG
}

GOOD:

onKeyPressOK: function() {
    return this.route("screen"); // GOOD
}