Created
June 3, 2017 18:55
-
-
Save stevermeister/ee9fdca12fd3895a1c9d19e8eb2c8de3 to your computer and use it in GitHub Desktop.
This file contains 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
export class TestComponent { | |
constructor(private route: ActivatedRoute, private router: Router) { } | |
ngOnInit() { | |
this.route.params.subscribe(console.log); | |
this.route.queryParams.subscribe(console.log); | |
this.route.fragment.subscribe(console.log); | |
this.route.data.subscribe(console.log); | |
this.route.url.subscribe(console.log); | |
this.router.events.subscribe(console.log); | |
} | |
ngOnDestroy() { | |
// You should unsubscribe from each observable here | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment