Angular Routing | LazyLoading | AuthGuard | multiple router-outlet | all in one video
ฝัง
- เผยแพร่เมื่อ 10 ก.พ. 2025
- In this video you will learn all about angular routing so that you can start building your dream project soon.
Source code Link: github.com/Tar...
=============================================
For any Business/Freelancing enquiry contact us
Gmail :- tarique.rkl@gmail.com
WhatsApp :- +917978073704
=============================================
ng-bootstrap link : ng-bootstrap.g...
Angular-FortAwesome Link : github.com/For...
Generate an application with routing enabled
ng new angular-routing --routing
The following command uses the Angular CLI to generate a basic Angular application with an application routing module, called AppRoutingModule, which is an NgModule where you can configure your routes. The application name in the following example is angular-routing.
Add components for routing
ng generate component login
To use the Angular router, an application needs to have at least two components so that it can navigate from one to the other. To create a component using the CLI, enter the following at the command line where login is the name of your component
Repeat this step for a second component but give it a different name. Here, the new name is forgot-password.
ng generate component forgot-password
again for not-found
ng generate component not-found
Defining a basic route
we first define all the basic route using routerLink for login, forgot-password,
then
Setting up wildcard routes
{ path: '**', component: }
if user type or try to go to a path which is not present in the application then we will redirect the user to page-not found component
Lazy loading
You can configure your routes to lazy load modules, which means that Angular only loads modules as needed, rather than loading all modules when the application launches. Additionally, you can preload parts of your application in the background to improve the user experience.
Preventing unauthorized access
Use route guards to prevent users from navigating to parts of an application without authorization. The following route guards are available in Angular:
---- CanActivate
```
export class YourGuard implements CanActivate {
canActivate(
next: ActivatedRouteSnapshot,
state: RouterStateSnapshot): boolean {
// your logic goes here
}
}
```
watch this video till the very end manything you will learn about a real world project
Thank you so much for ur work just with 30 mins you cleared several problems in my mind and you made my work more n more simpler
thanks is really very tiny for ur work
I would like to tell all the beginners, you have to follow this it's really Amazing you have to watch this till end.
Thank you so much 😊 I really appreciate
Yeah. Its the most appropriate tutorial in proper quick time. 👏👏
This video is exactly what I was looking for for a month already, Very sincere thanks from me.
In half an hour u have done a smart work bro... Thanks a lot
I think this is the best video for Learning Routing, Guard, Common Component, Form, Featuring Routing all main topics covered in single video 0f 30 minutes
Thanks. You saved 3 days of web searching with simple very clear video.
Best Angular tutorial i have watched so far...Love it!!
Amazing video. Though this was a 30 minutes video, the content covered was actually much! Angular is awesome and please create more projects as this one. Thank you so much
Yes, you are talented. there are lot more theories in this video about angular we cannot found in months
You are one of the finest content creator. Great work...
very good video with simple explanation
This cleared all my concepts for routing using angular
this one is awesome, in very less time, described whole routing
Excellent... awesome. Very nice video which covers great thing for Angular developers. You made my day brother.
great content loved it
Excellent nd to the point with details. Thanks.
Very Informative video, thank you
Awesome... Most recomended video guys.
This is one of the best Angular router videos till now.
I had lots of doubts about routing before but after this video, I have to say you won my heart.
Thank you so much for this video. I really appreciate the efforts.. A Big Like from my side and subscribe button hit.
I hope we will get such videos in the future.
one of the best video for beginners !! thank you soo much bro
Thanks for the help and amazing channel
Awesome... You have cleared all concepts
Thank you sir after this
I've created user role and given path
Sored role in session
And role based routing I've done
Very well explained it's very useful 😀
Very good video!
One thing: higher voice quality would benefits video a lot ;)
Aside that, very clear and efficient! Thx for this explanation!
This video cleared my my routing doubts thanks
really very good tutorial. thank you so mush brother.
This video is amazing to learn, thank u so much sir
Hi your explanation is very very nice. this is very very useful video
Asome bro .. 👍
Nice Video Tarik.
wow amazing tutorial sir
The best video out there addressing Angular routing, 30 mins full of information, Great Job Tarik and Keep it Up
Very useful video . Thanks
Thanks a lot, Bahut kuch samaj meh aaya .
Overall a good tutorial, next time I would recommend having two sets of code people can download.
One with the starting project, with all the html, styles and anything non-router related already added, and one with the finished project for reference.
Its easier for people to absorb information on a subject if they don't have to go through a lot of unrelated information first. The video is about routing but anyone following along will need to install and configure a bunch of packages and copy and paste a bunch of code. Thats unnecessary.
Excellent simple sharp and clear ThanksBro for your efforts.
Thankyou so much for your clear explanation
Best explanation
Good tutorial and Explanation! thanks for the effort!! ❣
really superb
best tutorial on angular rroutinng
Nice video
Fantastic!!!..Many Thanks
Really very helpful
Awesome buddy ❤❤
Perfect demo
thanks for this router video.....😊
I need this video. Awesome Explained 👍
That's awsome video
Very informative and on point. keep up the good work brother.
thank you sir it help me a lot understanding the basic root and structure of an angular application
Very helpful for Begginers . Great Quick start.
wao! a good video , it helps me at least
Awesome video. Thankyou
Hi Tarique,
Very usefull and informative tutorial.
Thank you🙏
Actually desiging login page is the best way to clarify all doubt about routing and authentication
Thank you brother, for your efforts.
Very helpful
Thank you very much sir. very helpful
Really Hatsoff Bro
@TB thanks for this great Vídeo..short but provide very clear logic in routing management. Cheers
Thanks for this information 👍😊
A fantastic video! Thank you for your efforts
Awesome.. Appreciate your efforts.
Thanks for such an excellent tutorial.
amazing explanation
Nice tutorial ....
Awesome... Thank you very much
awesome work!!!!!
Beautiful tutorial boss!!! Well done!!!
Best Way of explanation.
Very easy to understand
Awesome bro
Very well Done ! Thanks
Thank you so much for the video
great work brother, easy to understand
keep it up
Best video
Amazing SIR!
clear and concise,..thanks!
Thank you so much, you help me a lot
Great
eye opener
Man's a Legend
appericable very nice dude
Please post more about angular videos
Nice Video kindly make same in angular 17 version as soon as possible. Awaiting your video...............
Will upload soon
tysm sir this helped me a lot 🤩😇
instant like and subscribe
amazing content!!
Awesome
Perfect
Thanks a lot 👍
This is Gem
fantastic as always !!!
Bhagwan aapko bahut khush rakhe bhaiya
Thank you
Thank You so much.
Really great video, please make video about authentication and user management.
Thanks brother!
Thank you so much bro
1.000 likes for this video!
Thanks a lot