The site makes API calls to a server to deliver the HTML code.
What I am running into is that the code that comes from the server does not work. For example, here is a test example from my html component that shows the problem.
<div [innerHTML]="pageInfo.text | safeHtml"></div>
<p><button class="btn btn-default" (click)="btnclck('btngo')">Test</button></p>
The first line is loaded in on initiation when the site loads and then changes when you move to a new page.
The second is a test line that I placed in there just to illustrate my problem.
The second line works exactly as it is supposed to.
But if the same button code comes in from an api read from the database, it doesn't work.
If you look at the code in the code inspector, you will see that the Angular coding has been applied to the second, but not to the first.
My assumption is that because this dynamic text is loaded after the rest of the site, the angular coding is not applied to the button tag and as such, the onclick doesn't work.
How do I get around this?
The code has to come dynamically from a database.