NgSwitchCase

directive

npm Package @angular/common
Module import { NgSwitchCase } from '@angular/common';
Source common/src/directives/ng_switch.ts
NgModule CommonModule

Creates a view that will be added/removed from the parent NgSwitch when the given expression evaluate to respectively the same/different value as the switch expression.

Overview

@Directive({ selector: '[ngSwitchCase]' })
class NgSwitchCase implements DoCheck {
  ngSwitchCase: any
  ngDoCheck()
}

How To Use

<container-element [ngSwitch]="switch_expression">
  <some-element *ngSwitchCase="match_expression_1">...</some-element>
</container-element>

Selectors

[ngSwitchCase]

Inputs

Description

Insert the sub-tree when the expression evaluates to the same value as the enclosing switch expression.

If multiple match expressions match the switch expression value, all of them are displayed.

See NgSwitch for more details and example.

Constructor

constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef<Object>, ngSwitch: NgSwitch)

Members

ngSwitchCase: any

ngDoCheck()

© 2010–2018 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v5.angular.io/api/common/NgSwitchCase