I have a search field which triggers the search method when pressed enter.
<mat-form-field class="search-field">
<mat-label>Search</mat-label>
<input type="text" (keyup.enter)="search($event)" matInput #search>
<mat-icon matSuffix>search</mat-icon>
</mat-form-field>
when I press the search button I get the following error
ERROR TypeError: _r0 is not a function
at UploadPhotoComponent_Template_input_keyup_enter_4_listener (upload-photo.component.html:4)
at executeListenerWithErrorHandling (core.js:14296)
at wrapListenerIn_markDirtyAndPreventDefault (core.js:14331)
at platform-browser.js:582
at platform-browser.js:1278
at ZoneDelegate.invoke (zone-evergreen.js:364)
at Object.onInvoke (core.js:27149)
at ZoneDelegate.invoke (zone-evergreen.js:363)
at Zone.runGuarded (zone-evergreen.js:133)
at NgZone.runGuarded (core.js:27060)
However when I changed the template reference variable from #search to #searchFiled it works fine
<mat-form-field class="search-field">
<mat-label>Search</mat-label>
<input type="text" (keyup.enter)="search($event)" matInput #searchFiled>
<mat-icon matSuffix>search</mat-icon>
</mat-form-field>
What is the reason for this?