0.0.5 • Published 2 years ago

ngx-string-injector v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

ngx-string-injector NPM version

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