@@ -1151,14 +1151,14 @@ figure.image-display
1151
1151
:marked
1152
1152
Three collaborating directives are at work here:
1153
1153
1. `ngSwitch`: bound to an expression that returns the switch value
1154
- 1. `ngSwitchCase `: bound to an expression returning a match value
1154
+ 1. `ngSwitchWhen `: bound to an expression returning a match value
1155
1155
1. `ngSwitchDefault`: a marker attribute on the default element
1156
1156
1157
1157
.alert.is-critical
1158
1158
:marked
1159
1159
**Do *not*** put the asterisk (`*`) in front of `ngSwitch`. Use the property binding instead.
1160
1160
1161
- **Do** put the asterisk (`*`) in front of `ngSwitchCase ` and `ngSwitchDefault`.
1161
+ **Do** put the asterisk (`*`) in front of `ngSwitchWhen ` and `ngSwitchDefault`.
1162
1162
For more information, see [\* and <template>](#star-template).
1163
1163
1164
1164
<a id =" ngFor" ></a >
@@ -1293,16 +1293,16 @@ figure.image-display
1293
1293
:marked
1294
1294
### Expanding `*ngSwitch`
1295
1295
A similar transformation applies to `*ngSwitch`. We can unfold the syntax ourselves.
1296
- Here's an example, first with `*ngSwitchCase ` and `*ngSwitchDefault` and then again with `<template>` tags:
1296
+ Here's an example, first with `*ngSwitchWhen ` and `*ngSwitchDefault` and then again with `<template>` tags:
1297
1297
+ makeExample('template-syntax/ts/app/app.component.html' , 'NgSwitch-expanded' )( format ="." )
1298
1298
:marked
1299
- The `*ngSwitchCase ` and `*ngSwitchDefault` expand in exactly the same manner as `*ngIf`,
1299
+ The `*ngSwitchWhen ` and `*ngSwitchDefault` expand in exactly the same manner as `*ngIf`,
1300
1300
wrapping their former elements in `<template>` tags.
1301
1301
1302
1302
Now we can see why the `ngSwitch` itself is not prefixed with an asterisk (*).
1303
1303
It does not define content. It's job is to control a collection of templates.
1304
1304
1305
- In this case, it governs two sets of `ngSwitchCase ` and `NgSwitchDefault` directives.
1305
+ In this case, it governs two sets of `ngSwitchWhen ` and `NgSwitchDefault` directives.
1306
1306
We should expect it to display the values of the selected template twice,
1307
1307
once for the (*) prefixed version and once for the expanded template version.
1308
1308
That's exactly what we see in this example:
0 commit comments