I'm working on an application that has the following infrastructure:
- Headless Wordpress used as primary DB
- Node.js application used as middleware/backend
- Angular for the frontend
I'm in a situation where I need to fetch dynamic content from Wordpress (content of type "Page") for a particular section, the News section.
The problem is this: the news abstract can contain internal links to navigate to certain sections of the website.
This content, once arrived at the frontend, is injected through the "innerHTML" property into a div.
Now, I can't add the "routerLink" property directly on the HTML coming from Wordpress, because Angular sanitizes it.
At the same time, I don't want to remove sanitization process to avoid security issues.
I tried adding the "routerLink" property directly on the frontend, through ViewChild, but the content injected via "innerHTML" seems inert and not susceptible to updates.
Is there any way to fix this?
Thanks
<a href="/something">inside innerHTML content, and dorouter.navigate(['/something'])?