How to concatenate a data + string when passing component property?

Asked

Viewed 86 times

1

I’m using a component of kendoUi that I need to pass on the property [title] my variable local.LocalNome and local.LocalDataCadastro, but I need to apply the date pipe to my date variable.

I tried something like:

<kendo-panelbar-item *ngFor="let local of locaisList" [title]="local.LocalCadastroData | date + local.LocalNome">

That way I get:

Unexpected token '+' at column 32 in [local.Localcadastrodata | date + local.Localname]

How can I use my two pro variables title and apply the pipe date?

  • What is the value of your local.LocalNome ?

1 answer

3


You can use the property title without doing the Property Binding by inserting in the title value the two variables in the form of interpolation - {{ }}:

title="{{local.LocalCadastroData | date}} - {{ local.LocalNome}}"

You can see how it works here

Browser other questions tagged

You are not signed in. Login or sign up in order to post.