Ajout d'un exemple pour les appels http.
This commit is contained in:
@@ -8,10 +8,17 @@ import {Car} from "../core/model/car";
|
||||
})
|
||||
export class PromisesExampleComponent {
|
||||
car?: Car = {
|
||||
id: '1234567890',
|
||||
id: 1,
|
||||
brand: 'Toyota',
|
||||
model: 'Yaris',
|
||||
power: 12,
|
||||
numberOfSeats: 5
|
||||
};
|
||||
|
||||
/*
|
||||
// Async / Await -> + comparaison avec les then
|
||||
// new Promise "à la main"
|
||||
// les then chaînés
|
||||
// catch (avec 1 ou plusieurs then) -> try/catch avec un await
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user