refactor(Compiler): introduce ShimComponent to shim CSS & DOM in emulated mode

Closes #715
This commit is contained in:
Victor Berchet
2015-02-19 13:42:18 -08:00
committed by Misko Hevery
parent 5111f9ae37
commit d0ca07afaa
12 changed files with 486 additions and 705 deletions
+4 -1
View File
@@ -535,12 +535,15 @@ export class ProtoView {
): ProtoView {
DOM.addClass(insertionElement, NG_BINDING_CLASS);
var cmpType = rootComponentAnnotatedType.type;
var rootProtoView = new ProtoView(insertionElement, protoChangeDetector, shadowDomStrategy);
rootProtoView.instantiateInPlace = true;
var binder = rootProtoView.bindElement(
new ProtoElementInjector(null, 0, [rootComponentAnnotatedType.type], true));
new ProtoElementInjector(null, 0, [cmpType], true));
binder.componentDirective = rootComponentAnnotatedType;
binder.nestedProtoView = protoView;
var shimComponent = shadowDomStrategy.getShimComponent(cmpType);
shimComponent.shimHostElement(insertionElement);
return rootProtoView;
}
}