Skip to content

Conversation

brunolm
Copy link
Owner

@brunolm brunolm commented Jun 16, 2018

npx ng g c heroes/hero-details

to pass parameters to the router link

[routerLink]="[ '/heroes', hero.id ]"

to add a class if the route is active

routerLinkActive="active"

to get values from params

this.route.paramMap.pipe(map((params) => +params.get('id'))).subscribe((id) => {
  this.activeHero = this.heroes.find((hero) => hero.id === id);
});

Added the package ngx-take-until-destroy to unsubscribe observables.
https://github.com/NetanelBasal/ngx-take-until-destroy

@coveralls
Copy link

Coverage Status

Coverage increased (+1.6%) to 90.066% when pulling 9c0e7dc on feature/hero-details into 0684e5f on master.

@brunolm brunolm merged commit 4ada823 into master Jun 16, 2018
@brunolm brunolm deleted the feature/hero-details branch June 16, 2018 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants