refactor(ElementInjector): support components
- Allow to access containing component directive instance from the shadow DOM. - Allow to access app services of the app level injector of the component when the component is instantiated.
This commit is contained in:
@ -10,8 +10,8 @@ export function run () {
|
||||
var bindings = [A, B, C];
|
||||
var proto = new ProtoElementInjector(null, 0, bindings);
|
||||
for (var i = 0; i < ITERATIONS; ++i) {
|
||||
var ei = proto.instantiate(null,null);
|
||||
ei.instantiateDirectives(appInjector);
|
||||
var ei = proto.instantiate(null,null,null);
|
||||
ei.instantiateDirectives(appInjector, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ var count = 0;
|
||||
|
||||
export function run () {
|
||||
var appInjector = new Injector([]);
|
||||
|
||||
|
||||
var bindings = [
|
||||
new Binding(Key.get(A), () => new A(), [], false),
|
||||
new Binding(Key.get(B), () => new B(), [], false),
|
||||
@ -18,8 +18,8 @@ export function run () {
|
||||
|
||||
var proto = new ProtoElementInjector(null, 0, bindings);
|
||||
for (var i = 0; i < ITERATIONS; ++i) {
|
||||
var ei = proto.instantiate(null,null);
|
||||
ei.instantiateDirectives(appInjector);
|
||||
var ei = proto.instantiate(null,null,null);
|
||||
ei.instantiateDirectives(appInjector, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,11 +9,11 @@ export function run () {
|
||||
|
||||
var bindings = [A, B, C];
|
||||
var proto = new ProtoElementInjector(null, 0, bindings);
|
||||
var ei = proto.instantiate(null,null);
|
||||
var ei = proto.instantiate(null,null,null);
|
||||
|
||||
for (var i = 0; i < ITERATIONS; ++i) {
|
||||
ei.clearDirectives();
|
||||
ei.instantiateDirectives(appInjector);
|
||||
ei.instantiateDirectives(appInjector, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user