Angular 2 Tutorial - 33 - Route Parameters

Angular 2 Tutorial - 33 - Route Parameters

Codevolution

7 лет назад

44,746 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

RONI Karmakar
RONI Karmakar - 27.08.2018 12:40

thanks

Ответить
Vijay Kumar
Vijay Kumar - 22.07.2018 13:44

Can you please tell what is the difference between ActivatedRoute and ActivatedRouteSnapshot

Ответить
Sohail Anjum
Sohail Anjum - 03.02.2018 10:46

Thank u very much for this helpful videos

Ответить
Kumar Awadhesh
Kumar Awadhesh - 28.01.2018 20:00

nice tutorial sir

Ответить
brazza
brazza - 07.08.2017 19:14

Might want to mention about the limitation on using the snapshot method (which you explain in the next video). Great vids though!

Ответить
Ricardo Vallejo
Ricardo Vallejo - 26.07.2017 11:10

Merci

Ответить
Ramya Ayyappan
Ramya Ayyappan - 18.07.2017 12:30

it show id undefined

Ответить
Procrastitlán
Procrastitlán - 27.06.2017 22:27

Thanks, your tutorials are really clear and reduce the learning curve considerably.

Ответить
Kiran Kumar
Kiran Kumar - 17.06.2017 09:48

Can multiple views in a single component?

Ответить
chaosinorderrr
chaosinorderrr - 11.05.2017 13:39

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?

Ответить
Wild Zone
Wild Zone - 02.05.2017 15:11

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 :)

Ответить
Brett Sartain
Brett Sartain - 07.03.2017 18:00

This was extremely helpful. Thanks so much.

Ответить
Majid Lotfi
Majid Lotfi - 06.03.2017 22:23

Thanks for this tutorial, can you please post the file styles.css ? Thanks.

Ответить
Joshfw892
Joshfw892 - 22.02.2017 01:06

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!

Ответить
Alexis Gamarra
Alexis Gamarra - 11.02.2017 05:00

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!

Ответить