Комментарии:
thanks
ОтветитьCan you please tell what is the difference between ActivatedRoute and ActivatedRouteSnapshot
ОтветитьThank u very much for this helpful videos
Ответитьnice tutorial sir
ОтветитьMight want to mention about the limitation on using the snapshot method (which you explain in the next video). Great vids though!
ОтветитьMerci
Ответитьit show id undefined
ОтветитьThanks, your tutorials are really clear and reduce the learning curve considerably.
ОтветитьCan multiple views in a single component?
ОтветитьOnly the first item I click gets its ID displayed on page. All subsequent once don't. If I manually change the id in the url, only then it also reflects on the page. Any idea why?
ОтветитьHi thanks for this great tutorial .
I have a question :)
How can i pass multiple parameters in URL ?
For example i want to pass except ID and NAME .
Thanks :)
This was extremely helpful. Thanks so much.
ОтветитьThanks for this tutorial, can you please post the file styles.css ? Thanks.
ОтветитьI've been struggling with this issue for some time and finally managed to sort it, thanks for your clear and coherent instructions, just subscribed!
ОтветитьThanks for thi video!
I recommend to use this to access to parameters, with this code you can detect if the URL is modified even without a page refresh.
..
private parametersObservable: any;
..
ngOnInit() {
//This only work the first time the page is load
console.debug("this.route.snapshot.params['offerId']:", this.route.snapshot.params['offerId']);
//This works in any url change
this.parametersObservable = this.route.params.subscribe(params => {
console.debug("***offerId:", params['offerId']);
// In a real app: dispatch action to load the details here.
});
}
ngOnDestroy() {
this.parametersObservable.unsubscribe();
}
Thanks again!