I am trying to create a 'Custom Pipe' that adds a relative link to a word(s) from dynamic inputs based on certain pattern (or variable in this case) that has the input.
Example of input: 'Miami is the capital of Florida.' (where 'Miami' is the variable value).
Expected output: 'Miami' redirects to whatever relative link for now (I use routerLink
).
For now, I tried using innerHTML
property but the word is not clickable.
I reproduced the situation in this Stackblitz: https://stackblitz.com/edit/angular-link-pipes?file=src%2Fapp%2Fhtml.pipes.ts
UPDATE
Using Directives instead of Pipes could be another option.