简体   繁体   中英

ngx-translate in terinory condtion in angular 8

here the issue is ngx translate in ternary condtion.

{{ (videoConfig === true) ? 'Disable Video' : 'Enable Video' }}

i want to translate the word disable video and enable video in that condtion.how it is possible please help...

Try something like

{{ ((videoConfig == true) ? 'Disable Video' : 'Enable Video') | translate }}

or even

{{ (videoConfig  ? 'Disable Video' : 'Enable Video') | translate }}

should work also

Just wrap the ternary operator into () and it should be good.

{{ ((videoConfig === true) ? 'Disable Video' : 'Enable Video') | translate }}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM