fix(compiler): don’t type check property access of literal maps (#19301)
This was the behavior in Ng4, so we put the stricter check behind the `fullTemplateTypeCheck` flag. PR Close #19301
This commit is contained in:
@ -141,6 +141,12 @@ describe('ng type checker', () => {
|
||||
'<div>{{"hello" | aPipe}}</div>',
|
||||
`Argument of type '"hello"' is not assignable to parameter of type 'number'.`, '0:5');
|
||||
});
|
||||
it('should report an index into a map expression', () => {
|
||||
rejectOnlyWithFullTemplateTypeCheck(
|
||||
'<div>{{ {a: 1}[name] }}</div>',
|
||||
`Element implicitly has an 'any' type because type '{ a: number; }' has no index signature.`,
|
||||
'0:5');
|
||||
});
|
||||
it('should report an invalid property on an exportAs directive', () => {
|
||||
rejectOnlyWithFullTemplateTypeCheck(
|
||||
'<div aDir #aDir="aDir">{{aDir.fname}}</div>',
|
||||
|
Reference in New Issue
Block a user