68 lines
1.1 KiB
Plaintext
68 lines
1.1 KiB
Plaintext
|
|
||
|
p.location-badge.
|
||
|
exported from <a href='../directives'>angular2/directives</a>
|
||
|
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.32/modules/angular2/src/directives/ng_switch.ts#L135-L173">angular2/src/directives/ng_switch.ts (line 135)</a>
|
||
|
|
||
|
:markdown
|
||
|
Defines a case statement as an expression.
|
||
|
|
||
|
If multiple `NgSwitchWhen` match the `NgSwitch` value, all of them are displayed.
|
||
|
|
||
|
Example:
|
||
|
|
||
|
```
|
||
|
// match against a context variable
|
||
|
<template [ng-switch-when]="contextVariable">...</template>
|
||
|
|
||
|
// match against a constant string
|
||
|
<template ng-switch-when="stringValue">...</template>
|
||
|
```
|
||
|
|
||
|
|
||
|
.l-main-section
|
||
|
h2 Members
|
||
|
.l-sub-section
|
||
|
h3 constructor
|
||
|
|
||
|
|
||
|
pre.prettyprint
|
||
|
code.
|
||
|
constructor(viewContainer: ViewContainerRef, templateRef: TemplateRef, sswitch: NgSwitch)
|
||
|
|
||
|
:markdown
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
.l-sub-section
|
||
|
h3 onDestroy
|
||
|
|
||
|
|
||
|
pre.prettyprint
|
||
|
code.
|
||
|
onDestroy()
|
||
|
|
||
|
:markdown
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
.l-sub-section
|
||
|
h3 ngSwitchWhen
|
||
|
|
||
|
|
||
|
:markdown
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|