fix(platform-browser): should not throw for debug attrs containing $ (#14353)

Closes #9566

PR Close #14353
This commit is contained in:
Dzmitry Shylovich
2017-02-08 14:36:43 +03:00
committed by Miško Hevery
parent e5a144d902
commit 1cfbefebe3
2 changed files with 46 additions and 1 deletions

View File

@ -1507,6 +1507,14 @@ function declareTests({useJit, viewEngine}: {useJit: boolean, viewEngine: boolea
.toContain('ng-reflect-dir-prop="hello"');
});
it(`should work with prop names containing '$'`, () => {
TestBed.configureTestingModule({declarations: [ParentCmp, SomeCmpWithInput]});
const fixture = TestBed.createComponent(ParentCmp);
fixture.detectChanges();
expect(getDOM().getInnerHTML(fixture.nativeElement)).toContain('ng-reflect-test$="hello"');
});
it('should reflect property values on template comments', () => {
TestBed.configureTestingModule({declarations: [MyComp]});
const template = '<template [ngIf]="ctxBoolProp"></template>';
@ -2300,3 +2308,16 @@ class DirectiveWithPropDecorators {
class SomeCmp {
value: any;
}
@Component({
selector: 'parent-cmp',
template: `<cmp [test$]="name"></cmp>`,
})
export class ParentCmp {
name: string = 'hello';
}
@Component({selector: 'cmp', template: ''})
class SomeCmpWithInput {
@Input() test$: any;
}