-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Closed
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerbugstate: has PR
Milestone
Description
Which @angular/* package(s) are the source of the bug?
compiler
Is this a regression?
No
Description
I think I've narrowed down the reason for this error. I created an @Input() binding with the name valueOf. I think the angular compiler doesn't like this name for some reason, but I can't find any documentation on this being the case. I forked one of the Angular Material examples and updated the example a bit to demonstrate the error.
@Component({
selector: 'app-value-of',
template: '{{valueOf("abc")}}'
})
export class ValueOfComponent {
@Input() valueOf: (s: string) => any = (s: string) => s;
}
@Component({
selector: 'autocomplete-filter-example',
template: '<app-value-of [valueOf]="myValueOf"></app-value-of>',
})
export class AutocompleteFilterExample {
myValueOf = (s: string) => 'something else';
}Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw
./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: propName.toLowerCase is not a function
at eval (/home/projects/angular-jyiqdv/node_modules/@ngtools/webpack/src/ivy/loader.js:81:18)
./src/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: propName.toLowerCase is not a function
at eval (/home/projects/angular-jyiqdv/node_modules/@ngtools/webpack/src/ivy/loader.js:81:18)
Please provide the environment you discovered this bug in (run ng version)
This information can be found in the stackblitz reproduction. Looks like version 14.
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: compilerIssues related to `ngc`, Angular's template compilerIssues related to `ngc`, Angular's template compilerbugstate: has PR