Core: Combo raw HTML + param

Created on 22 Sep 2017  路  1Comment  路  Source: ngx-translate/core

I'm submitting a ... (check one with "x")

[ ] bug report => check the FAQ and search github for a similar issue or PR before submitting
[x] support request => check the FAQ and search github for a similar issue before submitting
[ ] feature request

Current behavior
<div [innerHTML]="'HELLO' | translate"></div>
Will output raw HTML tags defined in my JSON string value, which is working.

Expected/desired behavior
<div translate [innerHTML]="'HELLO' | translate" [translateParams]="{value: 'world'}"></div>

Is a combination of this possible? I have a value for output and in my JSON file I have a string with both raw HTML + a value that can be passed in.

So for now I have in my JSON file:
"CUSTOM_KEY": "Yes this is <b>{{ value }}</b>!"

Please tell us about your environment:

  • ngx-translate version: 7.2.0

  • Angular version: 4.3.6

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Most helpful comment

You can use the follow syntax:
<div [innerHTML]="'CUSTOM_KEY' | translate:{value: 'world'}"></div>

>All comments

You can use the follow syntax:
<div [innerHTML]="'CUSTOM_KEY' | translate:{value: 'world'}"></div>

Was this page helpful?
0 / 5 - 0 ratings

Related issues

apreg picture apreg  路  3Comments

dankerk picture dankerk  路  3Comments

jellene4eva picture jellene4eva  路  3Comments

bjornharvold picture bjornharvold  路  3Comments

webprofusion-chrisc picture webprofusion-chrisc  路  4Comments