DEV Community

Digamber Rawat
Digamber Rawat

Posted on • Originally published at positronx.io on

1 2

Angular 9|8 ngIf, ngIfElse, ngIfThen Tutorial with Examples

In this tutorial, we are going to understand Angular 9|8 ngIf, ngIfElse, ngIfThen structural directive with Examples. Angular 9|8 offers a wide range of basic directives which help you to render the template based on the condition applied to the template.

The structural directive in Angular 8 works on boolean value pattern if the value is true, then the template is rendered, and if the value is false or null, then it doesn’t render the template. I will show you in this tutorial how do Angular 8 structural directives work with examples. Let us take a closer look at the structural directive properties.

Property Detail
ngIf It’s write-only property works on boolean expression to identify as the condition to render a template.
ngIfThen It’s write-only property, it renders the template when the the condition return true.
ngIfElse

It’s write-only property, it renders the template when the the condition return false.

Angular 8 *ngIf Example

click here to read more

AWS GenAI LIVE image

Real challenges. Real solutions. Real talk.

From technical discussions to philosophical debates, AWS and AWS Partners examine the impact and evolution of gen AI.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs