1
In my template I have an interpolation that performs a call to function getNomeCliente
, passing the ClienteId
as a parameter:
<ng-template kendoGridCellTemplate let-dataItem>
<div class="whole-cell">
{{ getNomeCliente(dataItem.ClienteId) }}
</div>
</ng-template>
I need to search the client name in my array clienteList
and return only the customer name.
I tried something like:
public getNomeCliente(clienteId: string): string{
this.clienteList.filter((item) => {item.ClienteId.indexOf(clienteId) !== -1}).map((cliente) => { return cliente.ClienteNome});
}
but I get in visual studio:
A Function Whose declared type is neither 'void' nor 'any' must Return a value.
We’re missing a
return
there, no?– Felipe Avelar