ngx-string-injector
v0.0.5
Published
An easy, clean and customizable way to inject actionable HTML into strings. Useful for translations with placeholders that require links.
Downloads
3
Maintainers
Readme
ngx-string-injector
An easy, clean and customizable way to inject actionable HTML into strings. Useful for translations with placeholders that require links.
Problem
When dealing with translations, there are moments when we need to have links or click actions. Typically translations have placeholders to indicate where values should go since the location of the placeholder would be different depending on the language. For example:
In English:
Please click this link {0}.
In Japanese:
このリンク{0}をクリックしてください。
Many solutions online are not reusable, take time, messy and difficult to maintain. ngx-string-injector tries to solve all these issues.
Examples
Simple example: Link
Advanced example with reusable rendering: Link