CanLoad Guard in Angular Router & Preloading Strategies (2021)

CanLoad Guard in Angular Router & Preloading Strategies (2021)

Decoded Frontend

3 года назад

11,682 Просмотров

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


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

@DecodedFrontend
@DecodedFrontend - 20.07.2021 16:07

Do not forget to leave your honest feedback! I hope you will find something useful in this video :) Enjoy!

Ответить
@MK-we4dl
@MK-we4dl - 18.10.2023 16:44

Сенсей, помогите пожалуйста! При релоаде гвард отробатывает ДО загрузки проверочных данных в сервисе. По дереву загрузка даже не доходит до защищенного роута и переходит в корень "/". Первый грузится главный компонент и загружает данные, после чаилды с проверкой гварда по признаку из данных которые загрузил родительский компонент. При навигации всё отлично, но если сделать релоад то ничего не отрабатывает. Мотули лейзи, прелоад PreloadAllModules, гвард в провайдерах модуля с сервисами и компонентами версия 13.

Ответить
@Sevkingblade
@Sevkingblade - 23.03.2023 03:22

So it's like CanMatch for lazy-loaded routes. Might be an over simplification the way I said it but kinda like that

Ответить
@manojojha68
@manojojha68 - 03.12.2022 10:50

Can you please make video on Component life cycle hooks and ChangeDetectionStrategy?

Ответить
@playful_creations
@playful_creations - 02.12.2022 19:49

This is best channel. Can you please make video on component lifecycle hooks?

Ответить
@sahilvig8014
@sahilvig8014 - 11.08.2022 21:56

Can you please create some videos on angular testing.

Ответить
@shibinjohn2792
@shibinjohn2792 - 11.10.2021 03:30

Very helpful content. ❤
Much love brother🧡

Ответить
@DjokovicAirlines
@DjokovicAirlines - 08.10.2021 19:51

Hi, thanks for the video. It's really helpful.

But I have a question:
For example, you are at 'home' route and there you have a button 'personal profile' which leads to either 'auth/login' or 'personal/profile' (depending on your login status).
Each route (auth/... && personal/...) has separated module file (auth.module and personal.module) with lazy loading.
If I'm not logged in and I press 'personal profile' button - it relocates me to 'auth/login'.
So is it loads auth module or both auth and personal modules?

Ответить
@pawansahu8605
@pawansahu8605 - 22.09.2021 09:15

super like 🙏

Ответить
@pawansahu8605
@pawansahu8605 - 22.09.2021 08:51

nice explanation 👍, please create one video for how to implement openId, authentication and authorisation related topics 😊

Ответить
@Maryna768
@Maryna768 - 13.08.2021 10:03

thanks for the great content!

Ответить
@abdouafailal4869
@abdouafailal4869 - 11.08.2021 16:41

Amazing work <3 !!! keep up the good work, it will pay out soon

Ответить
@yevhen3934
@yevhen3934 - 01.08.2021 11:45

Hello Dmytro! It's a great and helpful video! We are very grateful for your activity and work. You help us a lot to understand difficult topics. Good luck to you!
It would be cool if you tell us about Smart and Dumb components. For example, a situation where we have many nested child components and if we want to transfer data from the deep child component to the parent, an "event emmiting hell" is formed . Someone suggest using a service with Subjects so that the parent subscribes to the stream and listens to these events of the deep child component. If we have a large project, then many services and subjects need to be created for this. I don't know if this solution is the best for such a case.
What do you think about this?

Also, I have one question and it would be great pleasure to hear your opinion.
Let's consider the following situation. We have a large Angular project. We have components that include styles in the @Component decorator. If we build the project, then our bundles will include these styles. Our styles will be in *.js files. As a result, we will have a project size of ~2 megabytes, as an example.
But, if we move our styles from components to global styles, using global classes in the components, and removing this binding in the @Component decorator, then after the project is built, they will be in *.css files. And the project will become ~1.7 megabytes in size, also as an example.
We can call this project optimization. But we have a stupid project architecture. Now our styles aren't attached to the components. But is this optimization worth it?
We do not adhere to the principles of Angular itself, as it seems to me. Some kind of confusion is going on. It was provided that in Angular a component is a template, styles and *.ts file.
Why am I asking for your opinion here? We have a project, and the senior dev has implemented it in the second described way, i.e. he brought all the styles from the components to the global styles and put them all in the assets folder. As a result, they will be imported into the style.css file, and they won't be in the javascript files after the build. For some reason it is disgusting to me 😁
But still we do not break the rules - styles in styles, javascript code in js files.
How do you find the perfect solution? Have we to write our own Webpack config for Angular?

Ответить
@only_one_chance
@only_one_chance - 29.07.2021 13:56

​Hey dude,
Love your channel. Thanks for such great content.
How about creating some portion on videos about ng-template, using templateRef, directives and components using ng-template etc. I think many people do a lot of mistakes using this techniques especially when creating embedded view through the controller. Thanks

Ответить
@rihardkrauz4696
@rihardkrauz4696 - 22.07.2021 09:41

So and what is the difference between purposes of canLoad guard and AuthPreloadingStrategy? Because both of them are doing the one thing - should we load lazy module or not. Maybe do you know any real-life examples of usages?

Ответить
@user-jl1jz5jv1g
@user-jl1jz5jv1g - 21.07.2021 15:21

Красавелла!!!

Ответить
@bromptonhorsing8597
@bromptonhorsing8597 - 21.07.2021 11:06

Great video, as always
It'd be really cool to see a video about import management (avoiding circular dependencies, yet having your imports not being ugly :) )

Ответить
@kavyashreebj5848
@kavyashreebj5848 - 21.07.2021 02:52

Hey Dmytro, thanks for all the awesome concepts! Could you please make one on the difference between changeDetectionStrategy.OnPush v/s ChangeDetectorRef.detach() ?

Ответить
@pastagaz4241
@pastagaz4241 - 20.07.2021 21:57

Awesome to see you talking about preloadStrategies. I have created a custom one on our project, with a pretty good option: it preload module only when user ‘mouseOver’ a menu link, with an array that save all preloaded modules to prevent trying to reload again.

Ответить
@aleksandrm3466
@aleksandrm3466 - 20.07.2021 20:57

This is the Best Angular channel. Thanks alot for your work, I am already waiting for the new video :)

Ответить
@gururajmoger8649
@gururajmoger8649 - 20.07.2021 20:19

Pls explain more stuff in angular

Ответить
@andresmauriciofajardoolaya2721
@andresmauriciofajardoolaya2721 - 20.07.2021 16:35

I was waiting for this video, thanks :)

Ответить