Below is a snippet of code from the Tour of Heros tutorial for Angular.io:
getHeroesSlowly(): Promise<Hero[]> {
return new Promise(resolve => {
// Simulate server latency with 2 second delay
setTimeout(() => resolve(this.getHeroes()), 2000);
});
}
The description states: To simulate a slow connection, import the Hero symbol and add the following getHeroesSlowly() method to the HeroService.
I understand that it is best practice to build websites based on slow connections with two examples of such being here and here.
But why would I set a timer to test the build (like the one that Angular suggests) instead of throttling the connection (say in Chrome)?