fix(view): fixed ProtoViewFactory to get all property bindings

This commit is contained in:
vsavkin
2015-05-11 16:07:25 -07:00
parent ac80df0959
commit 7f976381d5
2 changed files with 23 additions and 4 deletions

View File

@ -116,8 +116,9 @@ export class ProtoViewFactory {
var sortedDirectives = ListWrapper.map(elementBinders, b => new SortedDirectives(b.directives, directives));
var variableBindings = this._createVariableBindings(renderProtoView);
var protoLocals = this._createProtoLocals(renderProtoView);
var protoLocals = this._createProtoLocals(variableBindings);
var variableNames = this._createVariableNames(parentProtoView, protoLocals);
var protoChangeDetector = this._createProtoChangeDetector(elementBinders, sortedDirectives, componentBinding, variableNames);
var protoView = new AppProtoView(renderProtoView.render, protoChangeDetector, variableBindings, protoLocals, variableNames);
@ -128,9 +129,9 @@ export class ProtoViewFactory {
return protoView;
}
_createProtoLocals(renderProtoView):Map {
_createProtoLocals(varBindings:Map):Map {
var protoLocals = MapWrapper.create();
MapWrapper.forEach(renderProtoView.variableBindings, (mappedName, varName) => {
MapWrapper.forEach(varBindings, (mappedName, varName) => {
MapWrapper.set(protoLocals, mappedName, null);
});
return protoLocals;
@ -141,6 +142,11 @@ export class ProtoViewFactory {
MapWrapper.forEach(renderProtoView.variableBindings, (mappedName, varName) => {
MapWrapper.set(variableBindings, varName, mappedName);
});
ListWrapper.forEach(renderProtoView.elementBinders, binder => {
MapWrapper.forEach(binder.variableBindings, (mappedName, varName) => {
MapWrapper.set(variableBindings, varName, mappedName);
});
});
return variableBindings;
}