What is let-* in Angular 2 templates?

I came across a strange assignment syntax inside an Angular 2 template.

<template let-col let-car="rowData" pTemplate="body">
    <span [style.color]="car[col.field]">{{car[col.field]}}</span>
</template>

It appears that let-col and let-car="rowData" create two new variables col and car that can then be bound to inside the template.

Source: https://www.primefaces.org/primeng/#/datatable/templating

What is this magical let-* syntax called?

How does it work?

What is the difference between let-something and let-something="something else"?

2 Answers
2

Leave a Comment