As I understand it it is not possible to dynamically add a '(click)' attribute to an element of the DOM using Renderer2 in Angular 2+.
If this is true how do you lovely people add a '(click)' attribute when they are dynamically creating HTML in the component or what workaround do you use?
const element = this.renderer.createElement('a');
element.setAttribute('href', 'foobar'); // This works
element.setAttribute('(click)', 'foobar'); // This does not work
this.renderer.setAttribute? You can usethis.renderer.listenfor this.element.setAttributethen it should beonclick, not(click). And the proper way is usingrenderer.setAttributeas mentioned by @Lends(click)isn't a valid attribute name anyway