Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs(toh-5/dart): make dashboard more robust - match TS slice() #1688

Merged

Conversation

chalin
Copy link
Contributor

@chalin chalin commented Jun 17, 2016

Originally the dashboard TS expression ``heroes.slice(1, 5))` had been
written as:

_heroService.getHeroes().getRange(1, 5)

which is brittle; it fails if there are not enough heroes. Slice doesn't fail; an equivalent expression in Dart is

_heroService.getHeroes().skip(1).take(4)

This is now used.

Other changes:

  • Fix in css (missed TS-side update).
  • Ran dartfmt on heroes_component.dart.

@chalin
Copy link
Contributor Author

chalin commented Jun 17, 2016

@kwalrath @thso : ready for review and merge.

@Foxandxss Foxandxss added the dart label Jun 18, 2016
@kwalrath
Copy link
Contributor

LGTM, but @thso should take a look.

Originally the dashboard TS expression ``heroes.slice(1, 5))` had been
written as:

> _heroService.getHeroes().getRange(1, 5)

which is brittle; it fails if there are not enough heroes. Slice
doesn't fail; an equivalent express
ion in Dart is

> _heroService.getHeroes().skip(1).take(4)

This is now used.

Other changes:
- Fix in css (missed TS-side update).
- Ran `dartfmt` on `heroes_component.dart`.
@chalin chalin force-pushed the chalin-dart-toh-5-dashboard-fix-0617 branch from 79def94 to 9468973 Compare June 26, 2016 19:09
@kwalrath kwalrath merged commit f8e6b5d into angular:master Jun 28, 2016
@chalin chalin deleted the chalin-dart-toh-5-dashboard-fix-0617 branch June 28, 2016 21:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants