This is my template file outerLayout.html:
<section id="index-wrapper">
<navigation id="menu">menu1</navigation>
<article id="content">main content</article>
<footer id="footer">footer</footer>
</section>
This is my outerLayout.js
var $ = require('jquery');
var Backbone = require('backbone');
Backbone.$ = $;
var Maronette = require('backbone.marionette');
var compiledTpl = require('./outerLayout.html');
// console.info('compiledTpl({})', compiledTpl({}));
console.info('compiledTpl({})', compiledTpl({}));
var OuterLayout = Backbone.Marionette.LayoutView.extend({
template: compiledTpl({}),
el: '#main',
regions: {
menu: '#menu',
content: '#content',
footer: '#footer'
}
});
module.exports = new OuterLayout();
Here are the code in router to render the layoutView:
var AppRouter = Backbone.Marionette.AppRouter.extend({
routes : {
'': 'index'
},
index : function () {
var outerLayout = require('../layout/outerLayout/outerLayout');
outerLayout.render();
}
}
});
The render result is:
But the result should be this one:
In short words, the render function removed tag which is not my objective. How can I fix it?