fix(view): fixed ProtoViewFactory to get all property bindings
This commit is contained in:
+14
-1
@@ -365,7 +365,6 @@ export function main() {
|
||||
}));
|
||||
|
||||
tb.createView(MyComp, {context: ctx}).then((view) => {
|
||||
|
||||
expect(view.rawView.locals).not.toBe(null);
|
||||
expect(view.rawView.locals.get('alice')).toBeAnInstanceOf(ChildComp);
|
||||
|
||||
@@ -373,6 +372,20 @@ export function main() {
|
||||
})
|
||||
}));
|
||||
|
||||
it('should make the assigned component accessible in property bindings', inject([TestBed, AsyncTestCompleter], (tb, async) => {
|
||||
tb.overrideView(MyComp, new View({
|
||||
template: '<p><child-cmp var-alice></child-cmp>{{alice.ctxProp}}</p>',
|
||||
directives: [ChildComp]
|
||||
}));
|
||||
|
||||
tb.createView(MyComp, {context: ctx}).then((view) => {
|
||||
view.detectChanges();
|
||||
|
||||
expect(view.rootNodes).toHaveText('hellohello'); // this first one is the component, the second one is the text binding
|
||||
async.done();
|
||||
})
|
||||
}));
|
||||
|
||||
it('should assign two component instances each with a var-', inject([TestBed, AsyncTestCompleter], (tb, async) => {
|
||||
tb.overrideView(MyComp, new View({
|
||||
template: '<p><child-cmp var-alice></child-cmp><child-cmp var-bob></p>',
|
||||
|
||||
Reference in New Issue
Block a user