APP_INITIALIZER Token in Angular (Advanced, 2022)

  Рет қаралды 22,160

Decoded Frontend

Decoded Frontend

Күн бұрын

Пікірлер: 95
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
If you want to support my channel and you find my content useful I would be grateful if you share it with your colleagues and friends. Thank you!🙏
@p.s29
@p.s29 2 жыл бұрын
Already did! 😁
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Thanks a lot, Prateek! ;)
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
@Arsalan Majeed much appreciate it, Arsalan🙏🏻
@claudiuciprianbetiuc3985
@claudiuciprianbetiuc3985 2 жыл бұрын
Constantly doing it :) You have great content!
@Nabulio85
@Nabulio85 Жыл бұрын
Dmytro, award of best Angular instructor 🙏 Thank you very much.
@MarceloLopesS
@MarceloLopesS 2 жыл бұрын
Hi, would you mind making a video about push-based architecture? I'd love to learn more how to use it and why. Reactive Angular seems very sophisticated
@malyna
@malyna 2 жыл бұрын
Чудове пояснення, думаю було б круто зробити окрему серію відео по розбіру сорсів!
@TheNicoad
@TheNicoad 2 жыл бұрын
Your youtube channel is pure gold bar, hope you know it and feel good about it
@nanasarathi
@nanasarathi 2 жыл бұрын
You are a very good teacher... it was very informative. Thanks for sharing this video.
@OscarAndresPabonEstrella
@OscarAndresPabonEstrella 2 жыл бұрын
Your videos have helped me a lot, is not easy to find those kind of advanced things related with angular. Thanks a lot :)
@DenisBendrikov
@DenisBendrikov 2 жыл бұрын
Thanks a lot for showing how it works under the hood. Also it is worth mentioning that APP_INITIALIZER doesn't work if used in lazy loaded feature modules
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Thank you for the addition! You are absolutely right. Regarding 'under the hood' stuff, should I do dive more in the source code? :)
@DenisBendrikov
@DenisBendrikov 2 жыл бұрын
@@DecodedFrontend in your videos you do a great job with a high-level source code overview 👍 so I better leave you the choice of how deep you should dive
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
@@DenisBendrikov got you! Thanks 😊
@innocentmazando3808
@innocentmazando3808 Жыл бұрын
I knew I was gonna need this video and now I am using it at work. Thanks for the great video sir
@dimitridovgan6364
@dimitridovgan6364 2 жыл бұрын
Best Angular Tutorials!
@vitaliyboyanivskyy1225
@vitaliyboyanivskyy1225 2 жыл бұрын
Дякую за контент)
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Будь ласка 😉 Заходьте ще))
@user-fg6ng7ej6w
@user-fg6ng7ej6w Жыл бұрын
очень толковые содержательные видосы, спасибо. вся эта серия про DI крута
@JoeBoo532
@JoeBoo532 3 ай бұрын
Hi, could you please explain the benefits of assigning the response results to an observable instead of just using an array? Thank you! loving your vid by the way! :D
@ayoubalfurjani4531
@ayoubalfurjani4531 Жыл бұрын
This video was just right!, and my use case was exactly the same as the one mentioned in the example. Overall a great video. Keep it up
@volodimiryemshyn715
@volodimiryemshyn715 2 жыл бұрын
Nice, thanks you. Lately I had problem with one task. I used resolver but I can't use it in app component, this way will help me. You are really nice person!!!)
@davidrestrepo8176
@davidrestrepo8176 19 күн бұрын
Nice tutorial, something I've trying to do is to show a loader while the initial config of the app is being loaded but I haven't found a way to implement it
@vigneshwaran6410
@vigneshwaran6410 2 жыл бұрын
Awesome content😃, make more videos like this.
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Thank you, I will
@MP3D2Y
@MP3D2Y 2 жыл бұрын
Nice video! Now I can understand better what is happening behind scenes when using that token privider
@djedaaa2232
@djedaaa2232 2 жыл бұрын
Helped me! Gread video!
@ianvink
@ianvink 2 жыл бұрын
This was an excellent video.
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Glad you enjoyed it!
@thesweetvishu
@thesweetvishu 2 жыл бұрын
Great one...
@demidovmaxim1008
@demidovmaxim1008 2 жыл бұрын
Cool. Thank you for this video!
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
You are welcome :)
@yorikworld
@yorikworld 2 жыл бұрын
Дякую, крутий контент.
@innocentmazando3808
@innocentmazando3808 2 жыл бұрын
Powerful content as usual, thanks man
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Glad you liked it! :)
@horic007
@horic007 2 жыл бұрын
Awesome content! 👏🏻
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Thanks! Glad you liked it:)
@Nurtylek
@Nurtylek 2 жыл бұрын
I don’t think it’s a good idea to subscribe inside service, u could do it inside tap operator
@КонстантинСлавин-т6ъ
@КонстантинСлавин-т6ъ Жыл бұрын
Great tutorial and very informative, thanks!
@ansumanmishra9608
@ansumanmishra9608 2 жыл бұрын
Great tutorial! Keep up the good work 🙂
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Thanks, will do! :)
@miroslavpetrov3006
@miroslavpetrov3006 8 ай бұрын
Great, now how do I preload my LCP image
@malbarmavi
@malbarmavi 2 жыл бұрын
super good 😭😁👏👏
@isasunasra9910
@isasunasra9910 Жыл бұрын
Hello, first of all, thank you for all the amazing content. I wanted to know if there's a way to show some loader while APP_INITIALIZER is doing its job.
@hoangducnguyen8887
@hoangducnguyen8887 Жыл бұрын
Hey @DecodedFrontend, what's your desk setup?
@deniskoliban6664
@deniskoliban6664 2 жыл бұрын
Great video, thank you Dmytro😃. I think you don't need to use asObservable() if you use pipe() on BS, because pipe returns an observable)
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Hi Denis! it is a good point that made me actually investigate this a little bit this question and I found something interesting :) It turns out, that .asObservable() and .pipe() are not completely equivalent. The pipe() on BS returns actually the BehaviorSubject but the trick is that the .pipe() method narrows the return type to Observable, so TypeScript won't allow you to call the next() method though it actually BS. You can hack it using something like that `(this.endpoints.pipe() as any).next('value')` and in such a way emit a new value to the stream. But when you do `(this.endpoints.asObservable() as any).next('value')` you will get an runtime error because asObservable() returns actually the Observable that doesn't have next() method at all :) So... it seems like asObservable() is safer/stricter but while you use TypeScript I think it is ok to use both approaches.
@jakubdrewniak2668
@jakubdrewniak2668 Жыл бұрын
that is really nice approach, I didn't know that. but how does it different from making this kind of initialization in AppModule constructor? are there any advantages besides blocking app initialization before data from api is resolved? (of course this is huge advantage, I'm just wondering if there are more?)
@alpinestylecom
@alpinestylecom 2 жыл бұрын
Great Video. Why not just use a classic resolver for App Component instead?
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Thanks for the question! A couple of reasons: 1) Resolvers will be invoked after the App Component is created. 2) Resolvers are used when you resolve some data for some certain route but app config usually isn't something that depends on the Router.
@vlads3856
@vlads3856 2 жыл бұрын
Awesome content!
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Glad you enjoyed it!
@mohamedsami5078
@mohamedsami5078 2 жыл бұрын
Great content as always.
@oleksandrvorovchenko8674
@oleksandrvorovchenko8674 2 жыл бұрын
Great and useful as always! Thanks.
@alextiger548
@alextiger548 2 жыл бұрын
Good stuff. Thank you!
@blokche_dev
@blokche_dev 2 жыл бұрын
👍 Thanks for the valuable content you create and share. Do you plan to dig further into Angular CDK?
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Thanks for the feedback! Yes, I plan also the course about CDK :)
@andrija-official
@andrija-official Жыл бұрын
Great! Thank you
@ivanco_s
@ivanco_s 2 жыл бұрын
cool, thanks for making content like this 🙂
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
My pleasure!
@1997jugulator
@1997jugulator 8 ай бұрын
I'm wondering what is the benefit from using asObservable in service?
@dimitritsikaridze6220
@dimitritsikaridze6220 2 жыл бұрын
Great content as always. video tutorial on angular elements would be nice there isn’t much on youtube that is up to date
@_Greenflag_
@_Greenflag_ Жыл бұрын
Why do you need to convert a behaviourSubject, which is an observable, to an observable using asObservable( ) method ? To use a copy of it, similar to the slice ( ) method on array ?
@vpeti88
@vpeti88 2 жыл бұрын
Thanks for the excellent videos! Can you help me? Can you make a video about a plugin architecture with auto discorvery, anyway it's possible in frontend framework?
@m3kbeatz
@m3kbeatz 8 ай бұрын
But why app_initilazier doesn't block imported modules?
@Afdac247
@Afdac247 2 жыл бұрын
Also in addition I have a problem with my bundle sizes if you ever worked with three.js you will know that they don't have esm modules, so no tree-shaking and there for the whole 500 kb gets bundled into the final app, I feel that I would have to download the package in a standalone project rebuild it some so their exports can be converted to be available as es import would you like to connect to discuss
@shumilus
@shumilus 2 жыл бұрын
Thanks
@sunilvilluri385
@sunilvilluri385 2 жыл бұрын
@Decoded Frontend - I want to know how you are able to see the actual code implementation instead of d.ts files. Can you provide steps to do it
@chikkachokka3401
@chikkachokka3401 Жыл бұрын
you got it sunil? if yes, can you please share?
@sunilvilluri385
@sunilvilluri385 Жыл бұрын
@@chikkachokka3401 - there is a shift between editors which was trimmed in editing. There is no straight way to get it
@johnlambertasis6620
@johnlambertasis6620 2 жыл бұрын
Thank you sir, but can u do a tutorial about MEAN stack like doing something projects such as cloning twitter, facebook or something that can be cloned. Highly appreciated all your videos sir! Keep it up!
@sandeepdravidam7989
@sandeepdravidam7989 2 жыл бұрын
Great Content n Awesome way of explaining as always. Can u make a video on how to do @supercharge/promise-pool npm package like flow in Observable way . It would be great video to learn. It would be challenging for u n great learning for us 😉
@AlphaFrog1021
@AlphaFrog1021 2 жыл бұрын
there aren’t many tutorials on angular SSR
@sechabamothobi2616
@sechabamothobi2616 Жыл бұрын
Amazing
@beratsulimani9823
@beratsulimani9823 2 жыл бұрын
Hi Dimitry, Thanks for the great content, can APP_INITIALIZER be used for a fully standalone project.
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Do you mean if the project uses standalone components?
@beratsulimani9823
@beratsulimani9823 2 жыл бұрын
@@DecodedFrontend Yes Dimitry, without ngModules how APP_INITIALIZER can be used?
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
@@beratsulimani9823 then you have to provide APP_INITIALIZER token in the ``` bootstrapApplication(AppComponent, { providers: [ { provide: APP_INITIALIZER... } ] }) ``` like that
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
it is inside main.ts file
@beratsulimani9823
@beratsulimani9823 2 жыл бұрын
Thanks a lot Dimitry.
@exsitewebsolution6803
@exsitewebsolution6803 Жыл бұрын
hi great tut as usual! Could app_intializer be used to create a webmanifest dynamically? so that we can white label our APP to suit multiple customers.
@Alessandro_Russo
@Alessandro_Russo 2 жыл бұрын
When a complete overview about providers?
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
What do you mean?
@Alessandro_Russo
@Alessandro_Russo 2 жыл бұрын
An explanation of how providers work. I found it already you did thanks.
@denysdzhelomanov2633
@denysdzhelomanov2633 2 жыл бұрын
You don't need to write asObservable function before pipe, pipe func does the same job
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Hi Denys! Thanks for your comment :) I already answered a similar comment, so if you don't mind I will just duplicate the answer here: "it is a good point that made me actually investigate this a little bit this question and I found something interesting :) It turns out, that .asObservable() and .pipe() are not completely equivalent. The pipe() on BS returns actually the BehaviorSubject but the trick is that the .pipe() method narrows the return type to Observable, so TypeScript won't allow you to call the next() method though it actually BS. You can hack it using something like that `(this.endpoints.pipe() as any).next('value')` and in such a way emit a new value to the stream. But when you do `(this.endpoints.asObservable() as any).next('value')` you will get an runtime error because asObservable() returns actually the Observable that doesn't have next() method at all. So... it seems like asObservable() is safer/stricter but while you use TypeScript I think it is ok to use both approaches"
@olegshyshka5948
@olegshyshka5948 2 жыл бұрын
Thanks for support the Ukraine.
@MrBan001
@MrBan001 Жыл бұрын
What do i have to do if i want to use that config in another APP_Initializer?
@DecodedFrontend
@DecodedFrontend Жыл бұрын
You could save the fetched config in a separate service which is provided for the same injector where APP_Initializer token.
@haroldpepete
@haroldpepete 2 жыл бұрын
brutal video, if you ever need a liver or heart, let me know
@hubert.t4243
@hubert.t4243 2 жыл бұрын
Hi Dymitro. To go further up the tree, can I also use PLATFORM_INITIALIZER within the argument of platformBrowserDynamic in the main.ts and this will resolve before anything resolved within the APP_INITIALIZER. Thanks
@DecodedFrontend
@DecodedFrontend 2 жыл бұрын
Yes, it is. PLATFORM_INITIALIZERs are being executed befor APP_INITIALIZERs :)
Angular Json File - My Top 8 Settings (2022)
29:30
Decoded Frontend
Рет қаралды 27 М.
NgTemplateOutlet in Angular - Everything You Have to Know (2022)
35:15
Decoded Frontend
Рет қаралды 51 М.
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,9 МЛН
小天使和小丑太会演了!#小丑#天使#家庭#搞笑
00:25
家庭搞笑日记
Рет қаралды 59 МЛН
А что бы ты сделал? @LimbLossBoss
00:17
История одного вокалиста
Рет қаралды 9 МЛН
Angular Design Patterns - Bridge [Advanced, 2020]
24:34
Decoded Frontend
Рет қаралды 47 М.
Error Handling in Angular - Complete Guide (2022)
41:27
Decoded Frontend
Рет қаралды 69 М.
Build Generalized DRY Angular Code with Generics
14:44
Deborah Kurata
Рет қаралды 10 М.
Input Signals in Angular 17.1 - How To Use & Test
14:34
Decoded Frontend
Рет қаралды 28 М.
Angular Dependency Injection in Depth - Resolution modifiers (2021)
14:39
Resolver Guard in Angular Router (2021)
16:24
Decoded Frontend
Рет қаралды 28 М.
OpenAI Assistants API - Course for Beginners
3:32:55
freeCodeCamp.org
Рет қаралды 430 М.
State Management in Angular - Do I need Redux & NgRx? (2021, Advanced)
24:41
Angular Inject Function - New Way to Inject Services in Angular 14?
21:56
Ryan Dahl introduces JSR at DevWorld 2024
29:13
Deno
Рет қаралды 112 М.