/** * @license * Copyright Google Inc. All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, EmbeddedViewRef, Input, TemplateRef, ViewContainerRef} from '@angular/core'; /** * Conditionally includes a template based on the value of an `expression`. * * `ngIf` evaluates the `expression` and then renders the `then` or `else` template in its place * when expression is thruthy or falsy respectively. Typically the: * - `then` template is the inline template of `ngIf` unless bound to a different value. * - `else` template is blank unless its bound. * * # Most common usage * * The most common usage of the `ngIf` is to conditionally show the inline template as seen in this * example: * {@example common/ngIf/ts/module.ts region='NgIfSimple'} * * # Showing an alternative template using `else` * * If it is necessary to display a template when the `expression` is falsy use the `else` template * binding as shown. Note that the `else` binding points to a `