chore(examples): fix dart issues with router example

This commit is contained in:
Matias Niemelä 2015-07-08 18:01:03 -07:00
parent 206c9bdd74
commit 2c37cc5fcb
1 changed files with 5 additions and 5 deletions

View File

@ -15,10 +15,10 @@ class DbService {
constructor(public http: Http) {} constructor(public http: Http) {}
getData() { getData() {
return new Promise((resolve, reject) => { var p = PromiseWrapper.completer();
ObservableWrapper.subscribe(this.http.get('./db.json', {cache: true}), ObservableWrapper.subscribe(this.http.get('./db.json'),
(resp) => { resolve(resp.json()); }); (resp) => { p.resolve(resp.json()); });
}); return p.promise;
} }
drafts() { drafts() {
@ -56,7 +56,7 @@ class InboxDetailCmp {
constructor(db: DbService, params: RouteParams) { constructor(db: DbService, params: RouteParams) {
var id = params.get('id'); var id = params.get('id');
PromiseWrapper.then(db.email(id)).then((data) => { this.setEmailRecord(data); }); PromiseWrapper.then(db.email(id), (data) => { this.setEmailRecord(data); });
} }
get fullName() { return this.firstName + ' ' + this.lastName; } get fullName() { return this.firstName + ' ' + this.lastName; }