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
+14 -1
View File
@@ -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>',