This is a new way of Angular. Now they say that ngModules are optional which means it will soon transition to standalone like it was with hooks inside React
My developer experience has improved 5x since the release of standalone components. NgModules cause me sooo much frustration and friction. But now it's a pleasure. Also keep in mind, Angular gives instructions and some CLI commands to convert an app to be module-less.
Here are videos about my setup. Config files are in the descriptio. th-cam.com/video/j6uqOvTRq6I/w-d-xo.html th-cam.com/video/YrLiugDhCuk/w-d-xo.html th-cam.com/video/Xa4aOOB7XZo/w-d-xo.html
if I remove completely the app.module, do I need to import everything I need in every component? for ex. I have to import "RouterLink" in every component I will use it? is there a way to make some imports public in all components? I think modules did exactly this, right? XD
Unfortunately you are totally right There are no “global imports”: you need to import a component/pipe/directive every time you use it. ngIf, ngFor, and friends are available in every standalone component generated by the CLI, as the skeleton includes the import of CommonModule. But routerLink for example is not: you need to import RouterModule if you need it. Other frameworks, like Vue for example, allow registering some components globally, to avoid importing them over and over. That’s not the case in Angular.
@@MonsterlessonsAcademy oh I see thank you. I will try using this paradigm, but I think for now it is best to continue using ngModules for practicity in the imports :( at least this gave me a better understanding of how ngModules work 💯
WATCH NEXT: Angular Interview Questions and Answers - Dominate Your Next Interview - th-cam.com/video/5A_YKlVWMPo/w-d-xo.htmlsi=2DCn7yspEAAJ2H6l
Many videos I have watched for Standalone but none of them weren't understandable more than this! Thanks!
Glad it helped!
straight to the point, stay like this! true dev spirit.
Thank you!
really like your delivery. on point! keep them coming! thanks a lot.
Much appreciated!
Bravo!!! Great video, simple and powerful, It covers all I need to understand new angular 17-18 standalone components approach. Beers for you!
Glad it was helpful!
is there any advantage on doing this? why would I want to do this?
This is a new way of Angular. Now they say that ngModules are optional which means it will soon transition to standalone like it was with hooks inside React
@@MonsterlessonsAcademy thanks this is very interesting
My developer experience has improved 5x since the release of standalone components. NgModules cause me sooo much frustration and friction. But now it's a pleasure.
Also keep in mind, Angular gives instructions and some CLI commands to convert an app to be module-less.
I rerecord the whole angular ngrx course with standalone components and the amount of code is 30% smaller for sure.
all necessary details, helpful and understandable
basic on your experience - is application with ngModules or without more readable?
I like it more without modules. The rewritten angular ngrx project lost 20-30% of the code
what plugins did you use on you vim, are you using neovim?
Here are videos about my setup. Config files are in the descriptio.
th-cam.com/video/j6uqOvTRq6I/w-d-xo.html
th-cam.com/video/YrLiugDhCuk/w-d-xo.html
th-cam.com/video/Xa4aOOB7XZo/w-d-xo.html
how do you handle shared components if you do not want to create a shared modules?
I just do
/shared/components/button
/shared/components/input
Thank for the video. Please do a tutorial of standalone components using Angular 17. The app.module.ts file is no longer needed.
But why? There is zero changes with standalone in Angular 17. app.module.ts is not needed in 16 version also.
You can shorten your lazy loading code by removing the .then part. It will work ifthe component ormodule you import is a default export.
Good to know!
How to add dependencies like Angular material and use with Standalone components?
Just import a module in standalone component
Thanks! Very informative.
Glad it was helpful!
how to use service in standalone compoennt?
Just inject it in providers array
if I remove completely the app.module, do I need to import everything I need in every component? for ex. I have to import "RouterLink" in every component I will use it? is there a way to make some imports public in all components? I think modules did exactly this, right? XD
Unfortunately you are totally right
There are no “global imports”: you need to import a component/pipe/directive every time you use it. ngIf, ngFor, and friends are available in every standalone component generated by the CLI, as the skeleton includes the import of CommonModule. But routerLink for example is not: you need to import RouterModule if you need it. Other frameworks, like Vue for example, allow registering some components globally, to avoid importing them over and over. That’s not the case in Angular.
@@MonsterlessonsAcademy oh I see thank you. I will try using this paradigm, but I think for now it is best to continue using ngModules for practicity in the imports :( at least this gave me a better understanding of how ngModules work 💯
@@MonsterlessonsAcademy So, what is the benefit of using standalone components instead of module?
Мне очень нравится музычка в начале. Сочный бассок.