(click) event doesn't work?

Hey guys,

I add an html using the method below:

for (var i = this.controls.length - 1; i >= 0; i--) {
       console.log('control: '+this.controls[i]);
       document.getElementById('control-'+i).innerHTML = this.controls[i];
     }

I used this since i using [innerhtml] strips the “(click)” in the html and this works fine

image

image

but “(click)” won’t work and nothing is happening, not even an error appears.

here the code for the function to be called by click:

 openGlossary(){
    
    console.log('opening glossary....');
  }

Could you try to use

<div *ngFor="let control of controls">

I’m actually using it.

image

btw, i changed my code back to using [innerHtml] bind with the sanitizer which has the same output but (click) is still not working.