fix(platform-browser): should not throw for debug attrs containing $ (#14353)
Closes #9566 PR Close #14353
This commit is contained in:

committed by
Miško Hevery

parent
e5a144d902
commit
1cfbefebe3
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user