refactor(render): don’t use a global cache for property setters
Related to #2359
This commit is contained in:
@ -16,20 +16,25 @@ import {TemplateLoader} from 'angular2/src/render/dom/compiler/template_loader';
|
||||
import {CompileStepFactory, DefaultStepFactory} from './compile_step_factory';
|
||||
import {Parser} from 'angular2/change_detection';
|
||||
import {ShadowDomStrategy} from '../shadow_dom/shadow_dom_strategy';
|
||||
import {
|
||||
PropertySetterFactory
|
||||
} from '../view/property_setter_factory'
|
||||
|
||||
/**
|
||||
* The compiler loads and translates the html templates of components into
|
||||
* nested ProtoViews. To decompose its functionality it uses
|
||||
* the CompilePipeline and the CompileSteps.
|
||||
*/
|
||||
export class DomCompiler extends RenderCompiler {
|
||||
/**
|
||||
* The compiler loads and translates the html templates of components into
|
||||
* nested ProtoViews. To decompose its functionality it uses
|
||||
* the CompilePipeline and the CompileSteps.
|
||||
*/
|
||||
export class DomCompiler extends RenderCompiler {
|
||||
_templateLoader: TemplateLoader;
|
||||
_stepFactory: CompileStepFactory;
|
||||
_propertySetterFactory: PropertySetterFactory;
|
||||
|
||||
constructor(stepFactory: CompileStepFactory, templateLoader: TemplateLoader) {
|
||||
super();
|
||||
this._templateLoader = templateLoader;
|
||||
this._stepFactory = stepFactory;
|
||||
this._propertySetterFactory = new PropertySetterFactory();
|
||||
}
|
||||
|
||||
compile(template: ViewDefinition): Promise<ProtoViewDto> {
|
||||
@ -58,7 +63,7 @@ export class DomCompiler extends RenderCompiler {
|
||||
var pipeline = new CompilePipeline(this._stepFactory.createSteps(viewDef, subTaskPromises));
|
||||
var compileElements = pipeline.process(tplElement, protoViewType, viewDef.componentId);
|
||||
|
||||
var protoView = compileElements[0].inheritedProtoView.build();
|
||||
var protoView = compileElements[0].inheritedProtoView.build(this._propertySetterFactory);
|
||||
|
||||
if (subTaskPromises.length > 0) {
|
||||
return PromiseWrapper.all(subTaskPromises).then((_) => protoView);
|
||||
|
Reference in New Issue
Block a user