Angular translation problem when interpolating parameters with disinfection escapeParameters

When using angular -translate, I encounter an unusual problem (without translation), with interpolation options as date objects.

But first, first: here is the pluker.

.

Using the disinfection strategy "escapeParameters" in the translation provider,

why with json is formatted as follows:

$scope.title = { day: 'tomorrow', today: new Date() };

the results of my translations are always {} using compressed forms

{{'VARIABLE_REPLACEMENT' | translate : title}}

<translate="VARIABLE_REPLACEMENT" translate-values="{ day: 'tomorrow', today: title.today }">

As you can see, other ways to use angular translation seem to work fine. It's some kind of mistake? Or am I doing something wrong?

+4
2

, GitHub angular -translate: ​​ 2.11.2 ( ). .

0

. https://angular-translate.imtqy.com/docs/#/guide/19_security

, UTF-8 . : 'escape' [ "escapeParameters" ], .

, , , , , "". , , , , .

, "escape", .

+1

Source: https://habr.com/ru/post/1651663/


All Articles