How to connect Backbone.Marionette to an existing element without creating an additional element

Say I have two Backbone.Marionette profiles:

var FooView = Backbone.Marionette.ItemView.extend({ tagName: p, id: 'foo', template: this.templates.summary }); var BarView = Backbone.Marionette.ItemView.extend({ template: this.templates.summary }); 

And then I want to show them inside the application area, for example:

 App.contentRegion.show(new FooView/BarView()); 

The first view will create a new item.

and add it to the area. I thought the second method would be more like the standard Backbone view and join the region without creating a new element, but it wraps it in a tag. Is there a way to avoid this without using something like setElement ()?

+6
source share

Source: https://habr.com/ru/post/951266/


All Articles