Last active
March 11, 2016 07:07
-
-
Save ericxyan/eee8d96a39d9b2207f86 to your computer and use it in GitHub Desktop.
test
This file contains hidden or 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
import {Hero} from './hero'; | |
import {HEROES} from './mock-heroes'; | |
import {Injectable} from 'angular2/core'; | |
@Injectable() | |
export class HeroService { | |
getHeroes() { | |
return Promise.resolve(HEROES); | |
} | |
// See the "Take it slow" appendix | |
getHeroesSlowly() { | |
return new Promise<Hero[]>(resolve => | |
setTimeout(()=>resolve(HEROES), 2000) // 2 seconds | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment