feat: ngIf now supports else; saves condition to local var

This is great news to all of us that likes using *ngIf .

i was added to the master repository, but not delivered yet as part of the 2.4 version.

looking at the CHANGELOG it is part of the 4.0.0-beta.0 release.


NgIf syntax has been extended to support else clause to display template
when the condition is false. In addition the condition value can now
be stored in local variable, for later reuse. This is especially useful
when used with the async pipe.


Hello {{user.last}}, {{user.first}}!
<template #loading>Waiting...</template>

read it all here:

#13297  13061

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s