diff --git a/app/components/examples/book/book.ts b/app/components/examples/book/book.ts index 45fc2d5..08db9dc 100644 --- a/app/components/examples/book/book.ts +++ b/app/components/examples/book/book.ts @@ -44,17 +44,20 @@ import {BookService} from './service'; // And get BookService let bookService = injector.get(BookService); - return Promise.all([ - bookService.count().toPromise(), - bookService.getBooks().toPromise() - ]).then( - data => { - next.params.count = data[0]; - next.params.books = data[1]; + return new Promise((resolve, reject) => { + Promise.all([ + bookService.count().toPromise(), + bookService.getBooks().toPromise() + ]).then( + data => { + next.params.count = data[0]; + next.params.books = data[1]; - return true; - } - ); + resolve(true); + }, + error => reject(error) + ); + }); }) // Actual component class