fix(render): allow to configure when templates are serialized to strings
Introduces the injectable `TemplateCloner` that can be configured via the new token `MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN`. Also replaces `document.adoptNode` with `document.importNode` as otherwise custom elements are not triggered in chrome 43. Closes #3418 Closes #3433
This commit is contained in:
@ -54,7 +54,9 @@ import {
|
||||
DefaultDomCompiler,
|
||||
APP_ID_TOKEN,
|
||||
SharedStylesHost,
|
||||
DomSharedStylesHost
|
||||
DomSharedStylesHost,
|
||||
MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN,
|
||||
TemplateCloner
|
||||
} from 'angular2/src/render/render';
|
||||
import {ElementSchemaRegistry} from 'angular2/src/render/dom/schema/element_schema_registry';
|
||||
import {DomElementSchemaRegistry} from 'angular2/src/render/dom/schema/dom_element_schema_registry';
|
||||
@ -98,6 +100,8 @@ function _getAppBindings() {
|
||||
DomRenderer,
|
||||
bind(Renderer).toAlias(DomRenderer),
|
||||
bind(APP_ID_TOKEN).toValue('a'),
|
||||
TemplateCloner,
|
||||
bind(MAX_IN_MEMORY_ELEMENTS_PER_TEMPLATE_TOKEN).toValue(-1),
|
||||
DefaultDomCompiler,
|
||||
bind(RenderCompiler).toAlias(DefaultDomCompiler),
|
||||
bind(ElementSchemaRegistry).toValue(new DomElementSchemaRegistry()),
|
||||
|
Reference in New Issue
Block a user