Within my app.component.ts file, I have a function that is defined as follows:
export class AppComponent {
....
onRowSelected(record:any) {
this.selectedRecord = record;
}
....
}
This function is used in the app.component.html file as a callback when a table row is selected.
<tr *ngFor="let record of records">
<div onclick="onRowSelected(record)">
<!-- Create a checkbox for each row -->
<td>
<md-checkbox></md-checkbox>
</td>
<!-- For each entry in the config, create a cell -->
<td *ngFor="let column of config.columns"
....
</td>
</div>
</tr>
Even though the function is clearly present in my component, I am encountering an error message that states:
VM11199 Uncaught ReferenceError: onRowSelected is not defined
Why is this happening? Any insights would be appreciated.