谁能解释一下最新 Ember 中 Container 模块的用途是什么?
在设置和此测试开始时的使用示例:
module("Ember.View - handlebars integration", {
setup: function() {
Ember.lookup = lookup = { Ember: Ember };
lookup.TemplateTests = TemplateTests = Ember.Namespace.create();
container = new Ember.Container();
container.optionsForType('template', { instantiate: false });
}
test("template view should call the function of the associated template", function() {
container.register('template', 'testTemplate', Ember.Handlebars.compile("<h1 id='twas-called'>template was called</h1>"));