Passing Parameters to Route | Angular Routing | Angular 13+

preview_player
Показать описание
We have learned how to define a route in angular using Angular Routing. In a route we can also pass a parameter whose value can change dynamically. For example, let's say we want to display the details of a course. For that, we will have to redirect user to the CourseDetails Page.

In the Course details page, we want to display the course detail based on the ID of the course. For that, we can pass an ID parameter to the route whose value can change dynamically, and then retrive the value of that parameter from the Route and use it in our application.

The parameter which we pass to a route is called as route parameter. In this lecture you will learn:

1. What is a Route Parameter?
2. How to pass a Route parameter to a Route?
3. How to retrieve the value of Route parameter from the route.

To work with Route parameters, we also need angular to inject an instance of ActivatedRoute class.

Рекомендации по теме
Комментарии
Автор

I don't know much about you bro. However the way you are explaining things is awesome. I follow a couple of more youtubers who teach these things and they are really contributing like you. Atleast whatever I am and whatever I am doing, your contribution is beyond words. I was unemployed and didn't had money for basic necessities. I was privileged to have only a cellphone and internet. I was ready to study for 24 hrs however noone helped me. No institute, no friends, nothing. Thank you for all these materials and your time. God bless you. I am employed and now I could say i have seen things changing in a moment. But for that moment i struggled alot and your videos were lamp for me.thriving . I got the job with decent package. because of you people like me can do the impossible. God bless you.

ankitbaage
Автор

Excellent, I really love to see your angular content as you teaching just mind-blowing sir, It's really helping a lot. THANK YOU SIR

abdulaziz
Автор

How to get the api response from the other component in the course component where details are shown

gautamigaikwad
Автор

Hi Sir, the way explained the concepts were superb,
One clarification required that while we are injecting the course service in the course component, where the instance is created in the providers array of the component meta data.is-it provided in the root component.
Thanks in advance

karthikreddyboppidi
Автор

hi can u pls share this projects drive link? the one in desc is blank

karansanjeev
Автор

creating activeRoute: ActivatedRoute outside the constructor doesn't work why?

bestchannel
Автор

i found your tutorial and new instantly that it would solve my problem 😎
Could you please make a video on how to dynamically populate breadcrumbs depending on the route you're at? (including route
children)

cholasimmons
Автор

ERROR Error: Uncaught (in promise): NullInjectorError: R3InjectorError(AppModule)

TheKidrock
Автор

source code please sir in the description directive source code is there please provide source code of Routing Please sir

mohammedumar