Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
56-tools:angular [2018/03/06 23:59] – [Interpolation] Roge | 56-tools:angular [2018/04/08 20:48] (Version actuelle) – [*ngFor] Roge | ||
---|---|---|---|
Ligne 16: | Ligne 16: | ||
===== Ressources ===== | ===== Ressources ===== | ||
+ | https:// | ||
https:// | https:// | ||
Ligne 34: | Ligne 35: | ||
| '' | | '' | ||
- | ====== Interpolation | + | ==== Interpolation ==== |
Ligne 56: | Ligne 57: | ||
* ''< | * ''< | ||
- | * ''< | + | * ''< |
Ligne 68: | Ligne 69: | ||
===== Template reference variables ( #var ) ===== | ===== Template reference variables ( #var ) ===== | ||
+ | variable locale qui peut être utilisée par la suite : | ||
< | < | ||
<input #phone placeholder=" | <input #phone placeholder=" | ||
Ligne 73: | Ligne 75: | ||
<!-- phone refers to the input element; pass its `value` to an event handler --> | <!-- phone refers to the input element; pass its `value` to an event handler --> | ||
<button (click)=" | <button (click)=" | ||
+ | </ | ||
+ | |||
+ | ===== Directives structurelles ===== | ||
+ | |||
+ | ==== *ngIf ==== | ||
+ | |||
+ | Micro syntax: | ||
+ | < | ||
+ | <div *ngIf=" | ||
+ | </ | ||
+ | |||
+ | Equivallent full syntax: | ||
+ | < | ||
+ | < | ||
+ | <div class=" | ||
+ | </ | ||
+ | </ | ||
+ | ==== *ngFor ==== | ||
+ | |||
+ | Micro code: | ||
+ | < | ||
+ | <div *ngFor=" | ||
+ | ({{i}}) {{hero.name}} | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Equivalent full syntax: | ||
+ | < | ||
+ | < | ||
+ | <div [class.odd]=" | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== ngSwitch | ||
+ | |||
+ | Micro code: | ||
+ | < | ||
+ | <div [ngSwitch]=" | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Equivalent full syntax: | ||
+ | < | ||
+ | <div [ngSwitch]=" | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
</ | </ | ||
===== Input and Output properties ===== | ===== Input and Output properties ===== | ||
- | An **Input property** is a settable property annotated with an '' | + | An **Input property** is a settable property annotated with an '' |
// | // | ||
Ligne 85: | Ligne 148: | ||
- | An **Output property** is an observable property annotated with an '' | + | An **Output property** is an observable property annotated with an '' |
Ligne 105: | Ligne 168: | ||
+ | ===== Testing ===== | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | ===== Exemples et tests ===== | ||
+ | |||
+ | https:// | ||
+ | https:// | ||