UNPKG

783 BJavaScriptView Raw
1'use strict';
2
3module.exports = {
4 initializeEmberENV: function(templateCompiler, EmberENV) {
5 if (!templateCompiler || !EmberENV) { return; }
6
7 var props;
8
9 if (EmberENV.FEATURES) {
10 props = Object.keys(EmberENV.FEATURES);
11
12 props.forEach(function(prop) {
13 templateCompiler._Ember.FEATURES[prop] = EmberENV.FEATURES[prop];
14 });
15 }
16
17 if (EmberENV) {
18 props = Object.keys(EmberENV);
19
20 props.forEach(function(prop) {
21 if (prop === 'FEATURES') { return; }
22
23 templateCompiler._Ember.ENV[prop] = EmberENV[prop];
24 });
25 }
26 },
27
28 template: function(templateCompiler, string, options) {
29 var precompiled = templateCompiler.precompile(string, options);
30 return 'Ember.HTMLBars.template(' + precompiled + ')';
31 }
32};