Get one translate param from input and another from object in angular

Viewed 40

Inputs in translate file:

{{name}}
{{name1}}
{{name2}}
{{name3}}
{{name4}}
{{name5}}

Code:

<div
[someDirective]="(msg 
| translate: { name: object.payload.name|mypipe}: object.payload )  "
    ></div>

I want to apply a pipe on the name param only, therefore, I have defined it separately.

All other inputs are defined in the object.payload, therefore, I want it to pick it up from there. I do not want my code to go too long.

But, my code is not working. It just takes the name translate param and all other params are undefined.

If I remove:

{ name: object.payload.name|mypipe}

the code works fine and it gets all the translate params values from the object.

Is it actually possible to get one param like this and others from the object or it's not possible at all?

0 Answers
Related