Skip to content

Commit 2c37cc5

Browse files
committed
chore(examples): fix dart issues with router example
1 parent 206c9bd commit 2c37cc5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

modules/examples/src/routing/inbox-app.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ class DbService {
1515
constructor(public http: Http) {}
1616

1717
getData() {
18-
return new Promise((resolve, reject) => {
19-
ObservableWrapper.subscribe(this.http.get('./db.json', {cache: true}),
20-
(resp) => { resolve(resp.json()); });
21-
});
18+
var p = PromiseWrapper.completer();
19+
ObservableWrapper.subscribe(this.http.get('./db.json'),
20+
(resp) => { p.resolve(resp.json()); });
21+
return p.promise;
2222
}
2323

2424
drafts() {
@@ -56,7 +56,7 @@ class InboxDetailCmp {
5656

5757
constructor(db: DbService, params: RouteParams) {
5858
var id = params.get('id');
59-
PromiseWrapper.then(db.email(id)).then((data) => { this.setEmailRecord(data); });
59+
PromiseWrapper.then(db.email(id), (data) => { this.setEmailRecord(data); });
6060
}
6161

6262
get fullName() { return this.firstName + ' ' + this.lastName; }

0 commit comments

Comments
 (0)