Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 481 Bytes

the_asterisk_syntax.md

File metadata and controls

17 lines (12 loc) · 481 Bytes

The Asterisk (*) Syntax

The asterisk is syntactic sugar to make writing templates easier. Here is an example that uses the verbose <template> syntax:

<template [ngIf]="condition">
  <div>{{ hero }}</div>
</template>

Which can be simplified using the * syntax:

<div *ngIf="hero">{{ hero }}</div>

For more information see: angular.io/guide/template-syntax/star-template