Skip to content

Commit 3ec3d5e

Browse files
committed
perf(view): inline and refactor view instantiation and hydration
- Don’t convert DOM array into JS array via `Array.slice` - Inline static methods for instantiation and hydration - Misc cleanup Closes angular#291
1 parent 8acf9fb commit 3ec3d5e

File tree

11 files changed

+221
-252
lines changed

11 files changed

+221
-252
lines changed

modules/core/src/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function documentDependentBindings(appComponentType) {
5454
// The light Dom of the app element is not considered part of
5555
// the angular application. Thus the context and lightDomInjector are
5656
// empty.
57-
var view = appProtoView.instantiate(null, true);
57+
var view = appProtoView.instantiate(null);
5858
view.hydrate(injector, null, new Object());
5959
return view;
6060
});

modules/core/src/compiler/pipeline/element_binder_builder.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {int, isPresent, isBlank, Type, BaseException, stringify} from 'facade/lang';
2-
import {Element} from 'facade/dom';
2+
import {Element, DOM} from 'facade/dom';
33
import {ListWrapper, List, MapWrapper, StringMapWrapper} from 'facade/collection';
44

55
import {reflector} from 'reflection/reflection';
@@ -74,7 +74,9 @@ export class ElementBinderBuilder extends CompileStep {
7474

7575
_bindElementProperties(protoView, compileElement) {
7676
MapWrapper.forEach(compileElement.propertyBindings, (expression, property) => {
77-
protoView.bindElementProperty(property, expression);
77+
if (DOM.hasProperty(compileElement.element, property)) {
78+
protoView.bindElementProperty(expression.ast, property, reflector.setter(property));
79+
}
7880
});
7981
}
8082

0 commit comments

Comments
 (0)