Комментарии:
literally you are the best man wtf
ОтветитьThanks I've learned something new 🎉
ОтветитьAm a beginner its hard to understand 🥲
ОтветитьVery comprehensive tutorial. Thanks.
ОтветитьAwesome Awesom Awesome Video! Very detailed explanation! Thanks! :)
ОтветитьCould you please provide more cases where it can be useful except of the experimental mode?
ОтветитьDude, you did a really great job. I was aware about these features of Angular DI but also, I was always a bit struggling with deep understanding how does it work under the hood. Now I'm happy that I do :) Thank you man!
ОтветитьSuch a great video! Coming from the ReactJs background, the dependency injection in angular was totally not understandable for me, but you explained it great! Thank you!
ОтветитьI can only say thank you so much!!!!!!!
Ответить👌👌👌
ОтветитьHatsoff thanks
ОтветитьThank you 🌷
Just use larger font for watching comfortable
I still don't understand why when comparing the two they give false with the useClass, if when giving console.log of both services the same object is obtained, So if the Injector is not supposed to do:
token: LoggerService => Value: new ExperimentalLoggerService(),
and using the private experimentalLogger: ExperimentalLoggerService, the injector does:
token: ExperimentalLoggerService=> Value: new ExperimentalLoggerService().
To then inject the instances when the component is created, they both have the same value but their token is different. It should give true since its value is the same instance, I don't understand 😕
Здравствуй, Дмитрий. Спасибо за столь отличный материал. Но у меня всё-таки есть недопонимание на счёт useClass/useExisting. В чём разница между обычным провайдом
providers: [SomeService] и через useExisting, например, providers: [{ provide: SomeServiceTwo, useExisting: SomeService}] ? То есть в чём смысл такой подачи сервиса под другим "соусом"? Или в этом нет никакой разницы с точки зрения реализации кода, а всего лишь дело в каких-то паттернах, которые это требуют? Благодарю заранее.
Awesome explanation!
ОтветитьAll your videos are better than the Angular Docs
ОтветитьThank you bro, learned a lot.
ОтветитьGreat video! Dislikes are from Angular documentation team 😁
Ответитьu r the best
ОтветитьThis could be really useful to extend an existing project let's say a codebase developed for one country can be used by other teams to accommodate changes for other countries based on the useFactory concept ... Gonna use this approach, just awesome :D
ОтветитьPlease create a video on creating components from configuration file dynamically, thanks
ОтветитьThat's really good, mate! Saved me from a lot of trouble. Unfortunatelly the Angular documentation does not have as many examples as here, but now I think I have a solid grasp on that topic!
ОтветитьVery well explained and it's good to see some real world examples of usage which is something a lot of videos lack.
Ответитьlove from india make tutorial of content projection
ОтветитьThanks you so much for explaining DI in Angular in simple words. I have watched all your videos on Dependency Injection, very nicely explained . I want to memorize/revise these concepts quickly within few minutes, so could you please provide the source code for the same.
ОтветитьI don't know why angular DI is so much easier to understand when watching this rather than reading the docs
ОтветитьLoved content👍, can you make video on monkeypatching ngzone API.
Thanks for awesome video
Hello
What is the practical use case of useclass provider.
great video, well explained. Thank you very much :)
ОтветитьWow! It's really useful to me! Thanks a lot 👍
ОтветитьVery nice explanation !! Loved it!!
ОтветитьIt would be cool if you went in depth on tree-shakable providers. You mentioned them a few times but didn't really go into it.
ОтветитьThis was well-explained. Thank you very much. :)
ОтветитьPlease make a video on Angular Change Detection and Ivy Renderer.
ОтветитьGreat video man
ОтветитьWhat would be the best approach when, let's say, you had your application making the API calls on the same base URL but then some module(new section) was introduced that would make calls to a different base API URL?
ОтветитьDear developers! Thank you for watching my videos. I hope you will find it useful and I appreciate any feedback from you in comments. Have a productive week 😉
P.s IMPORTANT!!! @Alex Malkevich suggested in comments a very nice approach which allow you to make your useFactory even more flexible. Instead to provide all dependencies in deps: [...] you can provide just Injector and get dependencies via Injector.get(YourServiceHere). Using this approach you should not care any more if your factory function will get new dependency or if dependency order will be changed.
The pseudo-code would look like this:
{
useFactory: (injector: Injector) => injector.get(APP_CONFIG).experimentalEnabled ? ... : ... ,
deps: [Injector]
}
Thanks for suggestion, Alex!
Wow thanks. That was useful especially useFunction part
Ответить