How to Dynamically add click events to HTML Text based on Class or ID


instead of adding HTML event tags like (click)=“xyz()” i have a need to dynamically add the event on a static HTML string once rendered by either .class or #id. its an odd requirement but the server side is creating the text for the post and in the static post text i have 2 separate events i need to add by elementID’s. and they clicks should not override

Static Text can be as followed

<div id=""message>
Message of the Post
<div id="address">
... Address of the Event

basically since this entire text is coming as a string to the client side i need to be able to add seperate events to #message and #address without overlapping scope. we were able to do this in Javascript how can this be done in ionic and angular.

Thanks in Advance