Тёмный

Resolver Guard in Angular Router (2021) 

Decoded Frontend
Подписаться 50 тыс.
Просмотров 27 тыс.
50% 1

In this #Angular tutorial you will know how to resolve your date before some certain route will be activated by using router resolver. Also, we will go a little bit beyond it will have a look at how to use Angular Router Events in order to show a loading indicator to the user which will improve the user experience of your application. I hope you will find something useful!
📣 Become a Pro in Angular Material Theming (Advanced Workshop) 📣
bit.ly/angular-material-themi...
✅ Use 10%-off coupon code: RU-vid_DISCOUNT (Only 2 coupons left)
📣 Blazing fast GraphQL Backend just in 1 Day with Hasura Engine 📣
bit.ly/complete-hasura-course
✅ 20%-off coupon code: HASURA-EASY-START
Time Codes:
00:00:00 - Intro;
00:00:26 - Project introduction;
00:03:23 - Implement Resolve Guard;
00:09:56 - Intro to Router Events;
00:14:30 - Final words;
00:15:40 - Outro;
Source code:
github.com/DMezhenskyi/angula...
#webdevelopment #angulartip

Наука

Опубликовано:

 

16 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 64   
@DecodedFrontend
@DecodedFrontend 2 года назад
Please use time codes in video description to navigate through the video, check my courses and leave your feedback in comments! Thanks for watchin!
@davicampos802
@davicampos802 2 года назад
This channel is amazing , there is no word , every video you post about angular motivates me to learn
@DecodedFrontend
@DecodedFrontend 2 года назад
Happy to hear that! and your motivation motivates me to make more videos ;)
@dragorwyin9809
@dragorwyin9809 2 года назад
@@DecodedFrontend Yeah, that's true! Don't stop to upload such a great content. Even your sense of humor and faults are great :D Keeping those movies alive!
@yuwenchiou3911
@yuwenchiou3911 3 месяца назад
best angular tutorial i've seen so far, very practical, clear and useful.
@aleksandrm3466
@aleksandrm3466 2 года назад
This is super as usual, thanks a lot. It would be cool to see some video from you regarding RxJS operators that you often use and best places to use. Thanks in advance:)
@isasunasra9910
@isasunasra9910 Год назад
Awesome, just what I was looking for months, TYSM
@janardhanangurusamy1658
@janardhanangurusamy1658 2 года назад
Really amazing video to understand all the angular concepts more clearly 👏
@DecodedFrontend
@DecodedFrontend 2 года назад
Glad to hear that! Thanks
@SunnyVakil
@SunnyVakil 2 года назад
Really I got some more insight every time when I’m watching your videos, Can you make something for global errors handling in Angular. Last but not least Thank you so much ! for amazing and informative videos.
@gonzaloetchegaray5998
@gonzaloetchegaray5998 2 года назад
Nice video! The content of this channel is amazing. This kind of content is hard to find.
@craigiswayne
@craigiswayne 2 года назад
Great content, loved the techniques you used, especially merging of the observable streams, super useful. What I would have liked to have seen is the error scenario handling, to see what happens
@DecodedFrontend
@DecodedFrontend 2 года назад
Thanks for the hint :)
@pedrofernandes2005
@pedrofernandes2005 2 года назад
The routing resolve events is really useful, didn't know we have that.
@TheNsn666
@TheNsn666 2 года назад
you should make unit test deep dive that would be awesome
@krisnarusdiono1304
@krisnarusdiono1304 2 года назад
yeay, a course that i was looking for
@DecodedFrontend
@DecodedFrontend 2 года назад
Thanks Krisna!
@santoshraju9230
@santoshraju9230 2 года назад
Excellent!! Nice explanation. Thanks
@amar-iby
@amar-iby 2 года назад
thank you for this amazing video !
@sweetsamikshya
@sweetsamikshya 2 года назад
I am learning so much from you man :)
@andresmauriciofajardoolaya2721
@andresmauriciofajardoolaya2721 2 года назад
excellent video, thanks for spend your time do it
@mktrann
@mktrann Год назад
Thank you so much ❤!
@kelvinticllahuanacohuachac9562
@kelvinticllahuanacohuachac9562 2 года назад
Amazing bro, nice explanation. thanks a lot.
@mrthefankyy
@mrthefankyy 2 года назад
Guy, make all for being as a "Google Angular Developer Expert". Good luck!
@DecodedFrontend
@DecodedFrontend 2 года назад
Hi Dmitry! Believe or not, but this morning I officially became a Google Developer Expert in Angular 😄
@biniyammoges9040
@biniyammoges9040 2 года назад
it helped me! thanks bro
@rs4267
@rs4267 4 месяца назад
An other banger thanks 🎉
@hadirahmani7943
@hadirahmani7943 2 года назад
Thank you very much 😎😎😎
@nanasarathi
@nanasarathi Год назад
Very informative 👍
@akshaymhatre9123
@akshaymhatre9123 2 года назад
I get to learn new things with every video that you make. Great video as always. One suggestion - While uploading project on Github, can you create 2 branches, one with starter code and other with the Final solution?
@AlphaFrog1021
@AlphaFrog1021 2 года назад
that's really good idea I hope he sees it
@DecodedFrontend
@DecodedFrontend 2 года назад
I see it :) Thanks for suggestion, I will keep in mind it next time!
@ShashankGram
@ShashankGram 2 года назад
Thank you
@carlosiglesias8354
@carlosiglesias8354 2 года назад
Great resource
@DecodedFrontend
@DecodedFrontend 2 года назад
Thank you! Glad you liked it :)
@craigiswayne
@craigiswayne 2 года назад
love your hair! content is great as well, thanks
@carlosiglesias8354
@carlosiglesias8354 2 года назад
thanks again! I just copied your code into my project!😀
@b4m5
@b4m5 2 года назад
Thanks a lot, bro 🤟
@DecodedFrontend
@DecodedFrontend 2 года назад
You are welcome 🙂
@santhoshreddy7555
@santhoshreddy7555 2 года назад
Great video thank you. Can we use mutliple 's and can we display two angular applications in single page? pls tell me
@user-hd8dm5ur3i
@user-hd8dm5ur3i Год назад
Great video! What if we navigate to specific route second time, but don't want to see this 'progress-bar event' again. Can we cache our data with this Resolver and is it make sense?
@wiliam334
@wiliam334 Год назад
Thank you for it. But can u show us how to resolve the user data on page refresh once the user is on the user details page. In the example above the users url was harcoded on the user service. But how would u solve if the url was on the parent component? Thank you😊
@wiliamferraciolli5380
@wiliamferraciolli5380 Год назад
Hi thanks for the tutorial, but can you make one where the resolver depends on another resolver? Eg in this very same scenario where the user deep link onto a single user. But the difference would be that instead of hard coding the Users link, this would be provided by another resolver So getUsers need a resolver to get the list of users and its link (profile) then getUser will need to get the link from the usersResolver to them append the id to it thanks
@TimmyPl
@TimmyPl Год назад
Hi, what if the case if I want refresh resolved data ? I mean, in „shared service” way I will create something like refreshData subject and switchMap with it. How can I achieve this kind of behaviour in resolver ? Should I refresh entire page to get routing kick in and refresh the data ?
@sakarsr
@sakarsr 2 года назад
Thank you for this video, please let me know what extension your using to generate the resolver in vs code?
@DecodedFrontend
@DecodedFrontend 2 года назад
Hi! Thanks for a feedback. It called NX Console
@sakarsr
@sakarsr 2 года назад
@@DecodedFrontend thank you
@bigk9000
@bigk9000 2 года назад
I have that same extension that displays the import cost; however, whenever I import anything from `rxjs` (and not `rxjs/internal/Observable` or the like), mine reads out as "144.1k (gzipped: 28.6k)" while yours reads as "8.8k (gzipped: 2.8k)". Is there a certain setting I need to configure with the extension? Or is there something you have established with your app's configurations/settings? Like I alluded to previously with `rxjs/internal/Observable`, I saw this video on boosting an Angular app's performance (that was narrated and assumingly written by Jeff Delaney/Fireship), and he recommended to start importing from `rxjs/internal/Observable` directly. I also know there are the "static imports" that work like `import 'rxjs/Observable/add/map` or the like. I'm never sure which one I should use for which particular use case. Is there a diagram, a chart, or a question diagram/tree I can use for a reference? Apologies for the word vomit, but this has been an issue I've been trying to wrap my head around for a while and noticing the remarkably small import size you were getting for RxJS modules was incredibly perplexing for me. Any assistance is much appreciated!
@minnininja4777
@minnininja4777 2 года назад
Its great video, thanks for it. Also can you please tell me the extension you are using to show the imported module size in kb ?. Thanks in Advance.
@DecodedFrontend
@DecodedFrontend 2 года назад
Hi! It is this vs code extension marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost
@minnininja4777
@minnininja4777 2 года назад
@@DecodedFrontend thanks bro
@covertgravy
@covertgravy 2 года назад
will something like this resolve? return { listA: Observable, listB: Observable ... }
@Panossa
@Panossa 6 месяцев назад
I feel like 13:26 could be done much easier, in one Observable instead of three. Something along the lines of: export class AppComponent implements OnInit { isLoading$!: Observable; constructor(private router: Router) {} ngOnInit(): void { this.isLoading$ = this.router.events.pipe( filter((e) => e instanceof ResolveStart || e instanceof ResolveEnd), map((e) => e instanceof ResolveStart) ); } } When the event is a start event, it'll get mapped to true; else to false. No need to merge Observables or even have them on a class-level as variables. Or am I missing something?
@dennis87ist
@dennis87ist 2 года назад
It's admitted to inject some Store into the resolvers and dispatch action from them? Or the best practice is to inject the store only in parent component and dispatch all the actions needed to load it and all it's children?
@DecodedFrontend
@DecodedFrontend 2 года назад
I personally do not see any problems with that. Of course, it depends a lot on a concrete use-case but if you need, for instance, to dispatch some action or resolve data which depends on data from the Store and you need to do it right before the component for the route will be activated, then I do not see any other option as to inject the store in your resolver and use it there.
@ariyoayodejiifeoluwa65
@ariyoayodejiifeoluwa65 Год назад
please what's the name of the extension you used to generate the resolver
@DecodedFrontend
@DecodedFrontend Год назад
NX console
@khumozin
@khumozin 2 года назад
Nice video, however this does not work on Angular 12, please assist. Thanks
@khumozin
@khumozin 2 года назад
Actually, I'm using a resolver with a guard
@DecodedFrontend
@DecodedFrontend 2 года назад
Hi Khumo, Thanks for your feedback. Actually, it works with Angular 12.x, you probably should look for the issue on your end.
@dmrshack
@dmrshack 2 года назад
you are the good teacher, but sometimes we didn't understand because you start video and you are already create project and configure everything, that lost us...
Далее
skibidi toilet multiverse 039 (part 2)
08:58
Просмотров 5 млн
Which national team are you rooting for at Euro 2024?
00:17
TOP 6 Mistakes in RxJS code
18:35
Просмотров 14 тыс.
APP_INITIALIZER Token in Angular (Advanced, 2022)
23:56
🚦Angular Signals Game Changer: NgRx Signal State
11:38
Angular Router - The Basics and Beyond
11:47
Просмотров 128 тыс.
Angular Json File - My Top 8 Settings (2022)
29:30
Просмотров 26 тыс.
Смело ставь iOS 18
0:57
Просмотров 92 тыс.
ЗАКОПАЛ НОВЫЙ ТЕЛЕФОН!!!🎁😱
0:28