Ceci est une ancienne révision du document !
https://blog.angularindepth.com/
https://material.angular.io/components/categories
test dialog: https://stackblitz.com/edit/angular-sqspai?file=app%2Fdialog-overview-example-dialog.html
[(ngModel)] | Two-way data binding. |
[property] | Property binding. |
(event) | Event binding |
{{variable}}
interpolation. Les deux formes ci-dessous sont équivalentes:
<img src=“{{heroImageUrl}}”> is the interpolated image.
<img [src]=“heroImageUrl”> is the property bound image.
It flows a value in one direction, from a component's data property into a target element property.
You cannot use property binding to pull values out of the target element.
You can't bind to a property of the target element to read it. You can only set it.
Les deux formes ci-dessous sont équivalentes:
<button (click)=“onSave()”>Save</button>
<button on-click=“onSave()”>Save</button>
You often want to both display a data property and update that property when the user makes changes.
variable locale qui peut être utilisée par la suite :
<input #phone placeholder="phone number"> <!-- phone refers to the input element; pass its `value` to an event handler --> <button (click)="callPhone(phone.value)">Call</button>
An Input property is a settable property annotated with an @Input()
decorator. Values flow into the property when it is data bound with a property binding [property]
.
Exemple:
@Input() hero: Hero;
<app-hero-detail [hero]=“selectedHero”></app-hero-detail>
bind-hero=“selectedHero”
An Output property is an observable property annotated with an @Output()
decorator. The property almost always returns an Angular EventEmitter. Values flow out of the component as events bound with an event binding (event)
.
There are three kinds of directives in Angular:
https://psamsotha.github.io/angular/2016/12/16/angular2-testing-karma-systemjs.html
https://jasmine.github.io/api/edge/matchers.html
https://github.com/mgechev/angular-performance-checklist
https://blog.oasisdigital.com/2017/angular-runtime-performance-guide/