Explain how to trigger and listen Events in Marionette.js ?

devquora
devquora

Posted On: Feb 22, 2018

 

The events can be triggered using Marionette.trigger method. It can also be used to do additional processing of your application. There are two events that are triggered. They are, Before start - It is fired before your application is started and before the initializer is executed. Start - It is fired after the application starts and after the initializer is executed.

Example

MyApp.on("before:start", function(options){
  options.moreData = "Event firing in Marionette"
});

MyApp.on("start", function(options){
  if (Backbone.history){
    Backbone.history.start();
  }
});

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Marionette js Interview Questions

    What is Marionette.js ?

    Marionette.js is a composite application library for the Backbone.js. It simplifies the construction of the large-scale JavaScript applications. It is nothing but a collection of the common design and...

    Marionette js Interview Questions

    List some features of Marionette.js ?

    Features of Marionette.jsIt is scalable as the applications built-in modules with event-driven architecture. It is easily modifiable. It works with the specific need of your application. It has ...

    Marionette js Interview Questions

    What is current stable version of Marionette.js ?

    v4.1.2 is the current stable version of MarionetteJS....