forked from tbranyen/backbone.layoutmanager
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (20 loc) · 717 Bytes
/
Copy pathindex.js
File metadata and controls
25 lines (20 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// If you installed LayoutManager globally, you would do:
// var LayoutManager = require("backbone.layoutmanager");
// Since we want this to run without having to install LayoutManager...
var LayoutManager = require("../../node");
// Create a header View and notice that simply providing a path to a template
// will automatically load it.
var Header = Backbone.Layout.extend({
template: "header"
});
var layout = new Backbone.Layout({
template: "test",
views: {
"header": new Header({ el: false })
}
});
// Render the layout and echo out the contents.
layout.render().promise().then(function() {
// Should echo out: <header><h1>This is my header!</h1></header>
console.log(this.$el.html());
});