Posted On: Feb 22, 2018
Renderer in Marionette is used to render data into a template. It can be set by the View class by using the class method setRendered. It accepts two arguments. The first is the template that is passed to the view. The second is the data that is to be rendered into the template. This function returns a string that contains the result of applying data to the template.
Example
Marionette.View.setRenderer(function(template, data) { return _.template(template)(data); }); var myView = new Marionette.View({ template: 'Hello <%- name %>!', model: new Backbone.Model({ name: 'World' }) }); myView.render(); myView.el === '<div>Hello World!</div>';
Never Miss an Articles from us.
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...
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 ...
v4.1.2 is the current stable version of MarionetteJS....