Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
| Ambdós costats versió prèvia Revisió prèvia | |||
| development:angular:directivas-estructurales [27/01/2020 07:45] – mate | development:angular:directivas-estructurales [09/02/2020 14:51] (actual) – [ngSwitch] mate | ||
|---|---|---|---|
| Línia 45: | Línia 45: | ||
| == ngSwitch | == ngSwitch | ||
| - | | + | <code bash>ng g[enerate] c[component] components/ |
| + | <sxh typescript; title: ng-switch.component.ts> | ||
| + | ... | ||
| + | export class NgSwitchComponent implements OnInit { | ||
| + | mensaje = ' | ||
| + | } | ||
| + | ... | ||
| + | </ | ||
| + | <sxh html; title: ng-switch.component.html> | ||
| + | <div [ngSwitch]=" | ||
| + | < | ||
| + | <div *ngSwitchCase="' | ||
| + | <div *ngSwitchCase="' | ||
| + | <div *ngSwitchDefault> | ||
| + | </ | ||
| + | </ | ||
| + | <sxh html; title: ng-switch.component.html v2> | ||
| + | <button type=" | ||
| + | <div [ngSwitch]=" | ||
| + | <div *ngSwitchCase="' | ||
| + | < | ||
| + | </ | ||
| + | <div *ngSwitchCase="' | ||
| + | < | ||
| + | </ | ||
| + | <div *ngSwitchCase="' | ||
| + | < | ||
| + | </ | ||
| + | <div *ngSwitchDefault class=" | ||
| + | < | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||