When the Test is clicked, the function should be invoked. However, nothing happens when I click on it.
Here is the HTML component code:
<div class="row m-0 justify-content-between" *ngFor="let i of
k[currentk]?.details | keys">
<div (click)="test(i.name)">{{i.name}}</div>
</div>
And here is the corresponding TypeScript component code:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-test',
templateUrl: './test.component.html',
styleUrls: ['./test.component.scss']
})
export class TestComponent implements OnInit {
constructor() {}
ngOnInit() {}
test(name){
alert('Hello world');
}
}