0
試圖渲染browserify+nunjucksify
-d在ampersand-view
中編譯了預編譯模板。用「&」符渲染預先編譯的nunjucks(browserify + nunjucksify)
這個工作過程expectd:
var tpl = require('app1/template-1.nunj');
console.log(tpl.render({name: 'flemming', isDancing: 'perhaps'}))
這不:
var MainView = View.extend({
template: tpl.render,
bindings: {
'model.name': '[data-hook=name]'
}
});
我得到的錯誤是
Uncaught TypeError: Cannot read property 'dev' of undefined
AFAIK,這意味着this
的nunjucks是錯誤。 Ampersand-view
將自身設置爲this
用於渲染功能,掩蓋了nunjucks期望this
的效果。
任何解決方案?