Multiple Injection Example - ramybenaroya/ember-index GitHub Wiki
#####Multiple Content Injection example The following code:
// Brocfile.js
var EmberAddon = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp({
'ember-index': {
output: 'index.jsp'
content: [{
key: 'content-1',
file: 'example1.txt',
includeInOutput: true
includeInIndexHtml: false
},{
key: 'content-2',
file: 'example2.txt',
includeInOutput: true
includeInIndexHtml: true
}]
}
});
module.exports = app.toTree();
// app/example1.txt
<!-- content from example1.txt -->
// app/example2.txt
<!-- content from example1.txt -->
<!-- app/index.html -->
...
{{content-for 'ember-index-content-1'}}
<!DOCTYPE html>
<html>
<head>
....
</head>
<body>
{{content-for 'ember-index-content-2'}}
...
</body>
</html>
Will result
<!-- dist/index.html -->
<!DOCTYPE html>
<html>
<head>
...
</head>
<body>
<!-- content from example2.txt -->
...
</body>
</html>
<!-- dist/index.jsp -->
<!-- content from example1.txt -->
<!DOCTYPE html>
<html>
<head>
...
</head>
<body>
<!-- content from example2.txt -->
...
</body>
</html>