angular-cn/public/docs/js/latest/api/directives/SwitchWhen-class.jade

51 lines
959 B
Plaintext

p.
<span class="location-badge">exported from <a href="/angular2/directives">angular2/directives</a></span>
defined in <a href="https://github.com/angular/angular/tree/master/modules/angular2/src/directives/switch.js#L152">angular2/src/directives/switch.js (line 152)</a>
:markdown
Defines a case statement as an expression.
If multiple `SwitchWhen` match the `Switch` value, all of them are displayed.
Example:
```
// match against a context variable
<template [switch-when]="contextVariable">...</template>
// match against a constant string
<template [switch-when]="'stringValue'">...</template>
```
.l-main-section
h2 Members
.l-sub-section
h3 constructor
pre.prettyprint
code.
constructor(viewContainer: ViewContainer, sswitch: Switch)
:markdown
.l-sub-section
h3 when
pre.prettyprint
code.
when(value)
:markdown