Last active
January 14, 2017 15:01
-
-
Save wKoza/8a2136671a93dc85b1793a95377b61b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise<Article[]> articles = this.http.get('api.learn-angular.fr/articles') | |
.toPromise() | |
.then((res: Response) => res.json() as Article[]) | |
.catch(this.handleError); | |
... | |
private handleError(error: any): Promise<any> { | |
console.error('Une erreur est survenue : ', error); | |
return Promise.reject(error.message || error); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment