December 2017
Beginner
372 pages
10h 32m
English
In the last chapter, we were fetching the data in the Homepage component by calling the seedData method in our services call. Now, we will replace that with the call to this new method and fetch the data using promises. The following is the code we will use to make the call:
this._trelloService.getBoardsWithPromises() .then(boards => this.boards = boards, error => this.errorMessage = <any>error);
This code will be called from the ngOnInit method when the Homepage component is initialized. Here we are just making a call to the method getBoardsWithPromises and then resolve the response using the then function.
One thing to note here is that we are using the then function to handle both success and failure ...
Read now
Unlock full access