Getting Started with Standalone Components in Angular

  Рет қаралды 157,715

Angular

Angular

Жыл бұрын

Join the Angular team's very own Jessica Janiuk as she guides us through the getting started with the brand new Standalone Components feature in Angular.
Join the conversation online:
Angular Twitter → / angular
Jessica's Twitter → / thepunderwoman
Example Code:
github.com/angular/examples/t...

Пікірлер: 136
@kedevked
@kedevked Жыл бұрын
Angular keeps on becoming better and better 🎉🙏🏾
@bestraub98
@bestraub98 Жыл бұрын
Finally! This was the main feature angular was missing, compared to react and vue. It makes refactoring so much easier (just because less files are involved).
@rajtkbabu
@rajtkbabu Жыл бұрын
Amazing feature, when building with react component , we expected something we need here in Angular also.. Thanks you Angular team..
@lukash9952
@lukash9952 Жыл бұрын
Love this new feature! Used it already in prod project.
@josephsackeykontor4138
@josephsackeykontor4138 Жыл бұрын
I love this feature. Finally, it is here
@yuriimarshalofficial
@yuriimarshalofficial Жыл бұрын
Thanks for explaining, I rewrote the project today, removed all modules and set components as standalone. Now I feel like the most standalone programmer with all that provider functions at main.ts file. The framework is moving to splitted direct dependencies more and more. That's the great decision but also I so used to work with modules) For now my feature folder is determined with routing of lazy loading components. Please create more examples of all native modules providers that were wrapped by functions with new naming 🙏❤
@metric152
@metric152 Жыл бұрын
This is a great feature. Looking forward to when this is production ready
@md.zahidhasansohan6921
@md.zahidhasansohan6921 Жыл бұрын
great thanks for that! Very clear and articulate!
@MelroyvandenBerg
@MelroyvandenBerg 3 ай бұрын
Thanks for the link to the example code!
@thominchrist
@thominchrist Жыл бұрын
Great api, the ngmodule was time consuming for quick startup. But lazy loaded was existing in previous version
@nahuelleiva8460
@nahuelleiva8460 Жыл бұрын
This is an amazing feature because it reduces the number of files you'll need to handle in your project but I think it will be widely used to implement small components rather than bigger ones. For bigger/larger/more complex components, having separate things will be a cleaner and wiser approach. I don't see a component with a certain level of high complexity being developed using standalone components, having that much HTML code inside a single file could be a bit messy to deal with. But it's my guess, I could be wrong.
@derbenrich
@derbenrich Жыл бұрын
Yessss! Imho It will nudge you to split your components earlier down to reusable pieces, instead of the ever-growing monstrous components that mingle too much together! :D
@surajbande5841
@surajbande5841 Жыл бұрын
exciting feature! Thank you team for your efforts.. appreciate lot! Looks like Angular is becoming pure components based like other frameworks.. looking forward to using it soon in the project..!!
@JuanPablodelaTorre
@JuanPablodelaTorre Жыл бұрын
With the popularization of Single Component Angular Modules (SCAM), standalone components was the most obvious next step. I'm thrilled this happened so seamlessly. ps. Am I the only one weirded out by how clear the mic sound is? now I want to know what microphone was used.
@markthompson-g
@markthompson-g Жыл бұрын
I can tell you exactly which :) We used the Rode NTG3 for this video. Also, I'm so glad you are enjoying Standalone Components!
@JuanPablodelaTorre
@JuanPablodelaTorre Жыл бұрын
@@markthompson-g Hey! Thanks for the tip on the mic! And I'm loving standalone components. Perfect for dynamic instantiation too!
@stefanitotokocopullo2739
@stefanitotokocopullo2739 Жыл бұрын
Great feature and presenattion. Thank you
@babchenkonikolay911
@babchenkonikolay911 Жыл бұрын
This is so clean!
@otakujsdev
@otakujsdev 4 ай бұрын
THANK YOU! for such a great job!
@NagnathMungade
@NagnathMungade Жыл бұрын
Excited to work with this feature.
@danielm8482
@danielm8482 Жыл бұрын
thanks, very clear presentation
@joeyvico
@joeyvico Жыл бұрын
Beautiful!! This new feature sounds promising and it feels Angular is getting lighter and lighter. Thanks
@malobuchino
@malobuchino Жыл бұрын
thanks for the video, it was really informative
@rajivranjan1573
@rajivranjan1573 Жыл бұрын
much easier now! thanks.
@scottwong365
@scottwong365 Жыл бұрын
How does setting up specs work? Normally we define a testing module with all the imports/declarations.
@user-iy7rm7dt8x
@user-iy7rm7dt8x Жыл бұрын
Good video. Thank you.
@Whizyrel
@Whizyrel Жыл бұрын
I see, "I am standing here alone...". Nice entry point 😂
@elavarasur3458
@elavarasur3458 Жыл бұрын
NgModules essentially were a skeleton structure which gave angular apps its architecture and making them optional will allow developers to create apps in an unopinionated manner like react. Angular's inbuilt architecture is the one of the best features and an important reason to be adopted by enterprises and they just undid this. This looks like a step backward than forward. Can someone please tell me how this feature and this direction is a good thing....?
@ki9wi
@ki9wi 9 ай бұрын
can be used for small apps and made learning angular easier for absolute starters not having the modules concept as a must.
@f1am3d
@f1am3d Жыл бұрын
I've switched to Enterprise project based on React about a year ago, so I have the competence to compare two ecosystems. Damn, Angular is like a swizz knife has everything you need, has way better documentation and better standards, I kinda miss it. The only flaw is performance in some cases, but I think the Angular team will resolve this issue eventually by switching the compiler to esbuild and by making zone.js and rxjs optional. It can be faster and lighter without losing its versatility.
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
It is now, and signal-based components will be a total game changer. Signals as component inputs ftw! Cheers
@sned_dunes
@sned_dunes 10 ай бұрын
The documentation was exactly what made me choose Angular over React for my project
@respostasimples
@respostasimples Жыл бұрын
great, thanks!!
@TayambaMwanza
@TayambaMwanza Жыл бұрын
That pun took me 2 seconds but it definitely hit 🤣
@AdrianClaudiuDima
@AdrianClaudiuDima Жыл бұрын
Keep up the good work ! 👌👌🎉🎉 Although it is a very nice feature, I’m afraid it will not be used as per design, especially for the new devs staring with Angular.
@Gasprasound
@Gasprasound Жыл бұрын
Many thanks
@sanjaygarg3540
@sanjaygarg3540 Жыл бұрын
Amazing!
@tharindu79
@tharindu79 6 күн бұрын
Loved those puns 😊
@arjunshinde7
@arjunshinde7 Жыл бұрын
Its a great improvement towards moving to functional based programming from class based ones. I wish this will become the default in angular future. Makes beginners user friendly developers experience. Congratulations Angular !!!!😁🥳
@catalintudorciurte309
@catalintudorciurte309 Жыл бұрын
I doubt they will change from class components to function components. And they really shouldn't.
@MelroyvandenBerg
@MelroyvandenBerg 3 ай бұрын
When I use: `ng generate component DogsList --flat --standalone`. I no longer get the CommonModule as imports nor implements OnInit by default in my generated code. is that correct??
@olivierboisse1678
@olivierboisse1678 Жыл бұрын
Is it normal to not have the routerModule in the imports array of DogViewComponent (which is using ActivatedRoute from @angular/router) ? Do we need to add the module into the imports array only when we are using this module into the component template ?
@seabird021186
@seabird021186 Жыл бұрын
Sample of Demo is not good, If you use : Learn More This page will reload all scripts, images, including [main.js] . So, I recommend you demo with using [routerLink] to reload only script.
@GeoffTripoli
@GeoffTripoli Жыл бұрын
Ya, she actually says they are using the "routerLink" directive, but then they type an "href". Oops.
@zoro9878
@zoro9878 Жыл бұрын
angular is going to take over the front-end world!!
@fordiebody1981
@fordiebody1981 Жыл бұрын
Finally, coping up with react and other web frameworks.
@dr.d3600
@dr.d3600 Жыл бұрын
Cool for standalone components But are you error using href in a link?
@shivrajdeopa1571
@shivrajdeopa1571 Жыл бұрын
🙏 great presentation
@AbhiroopSantra
@AbhiroopSantra 5 ай бұрын
Love the way Angular is slowly making itself a clone of React 😆
@artemmalieiev7500
@artemmalieiev7500 Жыл бұрын
Is it possible to avoid doing boilerplate import of CommonModule ?
@CoderCoronet
@CoderCoronet Жыл бұрын
Super cool! What is the VS Code skin you’re using?
@JeromeGuarin
@JeromeGuarin Жыл бұрын
I think that's VS Code's high contrast theme
@markthompson-g
@markthompson-g Жыл бұрын
@@JeromeGuarin that is correct!
@adietltesa
@adietltesa Жыл бұрын
Hi. I hava a doubt. If You create a service to Open diálogs. How do You import the diálogModule in said singleton?
@durairajrajendiran9725
@durairajrajendiran9725 Жыл бұрын
Great guys, standalone components are stable now?
@collinsk8754
@collinsk8754 Жыл бұрын
Interesting addition 🤔. But, I think I'll stick to the existing modus operandi for components😎.
@turyng-or1js
@turyng-or1js 7 ай бұрын
"This is of a great IMPORTance"😍
@djglxxii
@djglxxii Жыл бұрын
What about service dependencies? For example, a service that depends on the HttpClientModule. Who imports that? I don't like the idea of the consuming component having to know about dependencies of dependencies.
@robertotomas
@robertotomas Жыл бұрын
How do standalone components play with federation?
@nathanalberg
@nathanalberg Жыл бұрын
I think its important to highlight that the lazy load method is `loadComponent`.... not `loadChildren` ... which is how other parts of my app are lazy loading modules... I didnt realize this and was getting `Error: ASSERTION ERROR: NgModule 'LoginPageComponent' is not a subtype of 'NgModuleType'. [Expected=> null != null
@gurpreetsingh6785
@gurpreetsingh6785 Жыл бұрын
Will standalone components work with scully?
@feelwang
@feelwang Жыл бұрын
I guess that means Shared “components” module now can be rightly replaced by a folder of standalone components?
@catalintudorciurte309
@catalintudorciurte309 Жыл бұрын
Exactly
@dusannovakovic8606
@dusannovakovic8606 Жыл бұрын
shared components module should not exist at all
@maxstetsenko8626
@maxstetsenko8626 Жыл бұрын
Great !)
@derrickc2823
@derrickc2823 Жыл бұрын
Will this increase the build size with all the imports? and is there any use for modules at all after this? Shared import maybe?
@catalintudorciurte309
@catalintudorciurte309 Жыл бұрын
This feature is especially usefull to replace the shared module pattern, where you just threw everything in there and imported it everywhere. The downside of standalone components, compared to ng-modules is that they provide no dependency encapsulation. So, the rule of thumb will be: "Will I need to hide dependencies and expose only SOME components?" Then you go for an ng-module, otherwise for standalone components
@Tomas-ir8xl
@Tomas-ir8xl Жыл бұрын
No, it actually decreases production bundle size (especially if you import only specific directives and pipes instead of importing whole "CommonModule" and "RouterModule" everywhere). Just migrated a small project and the "initial chunk" file size decreased by around 3% after migration.
@kenlnetherland
@kenlnetherland 4 ай бұрын
Can these be npm packaged?
@LimitlessMinds
@LimitlessMinds Жыл бұрын
There are no links to the example project as said at the end of the video 😅
@cykablyat867
@cykablyat867 Жыл бұрын
Greeeeeat
@holycrimpsauce
@holycrimpsauce Жыл бұрын
Dope
@softlion2023
@softlion2023 Жыл бұрын
saludos seria muy bueno si estuviera también en español para la comunidad que no hablamos ingles fluido... gracias
@bensadik
@bensadik Жыл бұрын
Very cool, I'm using standalone components only since it got out, my app got no modules whatsoever
@fitsuit1555
@fitsuit1555 Жыл бұрын
How did it affect your bundle size?
@pazzuto
@pazzuto Жыл бұрын
As Fit suit asked, I'm also interested to know the bundle size. How did it compare to the old version?
@Tomas-ir8xl
@Tomas-ir8xl Жыл бұрын
@@fitsuit1555 It reduces the bundle size. In my case "initial chunk" file size decreased by around 3% after getting rid of all NgModules.
@miroslavpetrov3006
@miroslavpetrov3006 7 ай бұрын
Will this new feature reduce the total blocking time in google web page speed? If yes this is HUGE!
@ben-barbier
@ben-barbier Жыл бұрын
@LuadoO
@LuadoO Жыл бұрын
What vscode theme is she using? :OO
@sharathmohan8316
@sharathmohan8316 Жыл бұрын
this is how out minds think, in components rather than modules
@rk1484
@rk1484 Жыл бұрын
In angular 2 also ng module concept was not there
@tusharbhattacharya6215
@tusharbhattacharya6215 Жыл бұрын
What was the vscode theme?
@markthompson-g
@markthompson-g Жыл бұрын
high contrast :)
@randomlee101
@randomlee101 Жыл бұрын
How do I upgrade my current project to Angular 14? I want to be able to add title to my routes 🙂
@peterniks
@peterniks Жыл бұрын
ng update
@randomlee101
@randomlee101 Жыл бұрын
@@peterniks thank you
@onlinetech2023
@onlinetech2023 Жыл бұрын
🎉
@RobbieSherman
@RobbieSherman Жыл бұрын
Why did you add "!" after dog and index in Input'ing them?
@williamboshi1855
@williamboshi1855 Жыл бұрын
Iirc ? Is "type or null or undefined" while ! Is "I know I'm not initialising my var but trust me bro it won't be null" cause Angular will inject the value and typescript doesn't know that
@dimitritsikaridze6220
@dimitritsikaridze6220 Жыл бұрын
it's because of tsconfig option strictTemplateChecking is set to true edit: correction - it's just property "strict" that is set to true in tsconfig which applies all kinds of strict settings, if you want to get rid of "!" you need to set new property strictTemplateChecking to false
@jonathancalderon9083
@jonathancalderon9083 Жыл бұрын
I saw you were using the "redirect" as the first route,I learned at Docs that should precede the wildcard. anyways, the explanation was extremely good
@LettuceBunnies
@LettuceBunnies Жыл бұрын
She just wanted to redirect from `/` to `/list` not any page.
@datguy4104
@datguy4104 7 ай бұрын
Sick
@samuelmadaras4377
@samuelmadaras4377 Жыл бұрын
What is the meaning of "!" in "@Input() dog!: Dog;"?
@Angular
@Angular Жыл бұрын
That's called the "Non-null assertion operator" and it asserts that the value of the input passed into the component won't be null. Here's more information: www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#non-null-assertion-operator
@Meolafon
@Meolafon Жыл бұрын
Very interesting, but I am a bit concerned about editing templates as a string (no IDE support) inside of a component file
@JuanPablodelaTorre
@JuanPablodelaTorre Жыл бұрын
VS Code supports syntax highlight and intellisense for inline templates. But you can still use a separate HTML file for the template as usual.
@Tomas-ir8xl
@Tomas-ir8xl Жыл бұрын
You don't have to use inline templates with "standalone" components. The feature helps you get rid of NgModules, it has nothing to do with inline html template.
@murilomorilonalmeida143
@murilomorilonalmeida143 Жыл бұрын
"Import...tance." and "view... of that." The face after the jokes killed me. x) Angular is more awesome...er. Btw, What a weird vscode theme. o.o
@programmercouple
@programmercouple Жыл бұрын
"Standing Alone" to tell us about StandAlone Components...good one 😂😂
@WesFanMan
@WesFanMan Жыл бұрын
...simplified the Angular learning tree... yeah, good luck with that.
@manit77
@manit77 10 ай бұрын
it would be cool if the standalone component can define its own route. Then there would not be a need to define it in app routes or module routes.
@Angular
@Angular 10 ай бұрын
What's your thought process for how this would work?
@datguy4104
@datguy4104 7 ай бұрын
This is a really bad idea. Like incredibly bad. Please don't do this lol
@theanswer1993
@theanswer1993 Жыл бұрын
So Angular is becoming more like React and Vue?
@TayambaMwanza
@TayambaMwanza Жыл бұрын
This is something the Angular team has been aiming for a while, ngModules was always a temporary solution, I don't think you can say that standalone components is really special to any particular framework it's just that Angular didn't have it.
@andreip.8321
@andreip.8321 3 ай бұрын
so painful seeing the navigation to dogView using a href...
@pepew7102
@pepew7102 Жыл бұрын
Do you have any plan of removing RxJS completly from Angular ?
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
Hopefully not. Promises suck
@pepew7102
@pepew7102 Жыл бұрын
@@LarsRyeJeppesen The reason why Angular is struggling to survive is mainly RxJS (and modules). It's adding unecessary complexity. React, Vue, Svelte, Solid, etc are working perfectly fine without RxJS.
@LarsRyeJeppesen
@LarsRyeJeppesen Жыл бұрын
@@pepew7102 I dont think A gular should be dummed down by looking at older frameworks like you mentioned. Observables are vastly superior to promises.
@pepew7102
@pepew7102 Жыл бұрын
@@LarsRyeJeppesen I agree that observables are more powerful than promises but also a lot more complicated to understand. And most of the time the power of observables is just not necessary (for example http requests).
@catalintudorciurte309
@catalintudorciurte309 Жыл бұрын
Angular is coupled forever with rxjs. It will never go away. Nor should it go away. Rxjs is one of the most rewarding libraries there are
@chaka1530
@chaka1530 Жыл бұрын
Are there people who are fan of modules, or I am the only one? I like when the enterprise projects are structured in a neat way using NgModules. Switching to standalone components seems unnecessary and potentially messy as the app grows.
@fetis26
@fetis26 Жыл бұрын
you're not alone here. you'll have to group them anyway at the end
@mentoriii3475
@mentoriii3475 Жыл бұрын
As an experienced react dev I'm happy when i see angular becoming better, glad the team is working extra hard to improve angular and make it on par with react
@theanswer1993
@theanswer1993 Жыл бұрын
What is the advantage if you are already fine with the module approach? As far as I see it's just a simplified version of Angular for those coming from React and Vue aka less skilled developers who want to get into Angular but can't figure out Modules. So I see this more of a survival move from Google as Angular started to become less and less popular as noobs don't want to start with it.
@catalintudorciurte309
@catalintudorciurte309 Жыл бұрын
There are advantages, especially in replacing the SCAM pattern
@back-ups7919
@back-ups7919 3 ай бұрын
She speaks Tahoma
@HasanBGuner
@HasanBGuner Жыл бұрын
Good info but not professional. Because it doesn't talk about concrete roadmap. What is the place of module and component in the future. Doesn't give confidence about how to design for future compliance.
@cmntkxp
@cmntkxp Жыл бұрын
Watering down to react level
@catalintudorciurte309
@catalintudorciurte309 Жыл бұрын
Neh, it is good to have options. ng-modules will not dissapear, standalone components will just replace the SCAM pattern
@TayambaMwanza
@TayambaMwanza Жыл бұрын
How is it watering down to have components manage dependencies directly? I actually found it's easier to organize your codebase than shared module.
@davidcaravan
@davidcaravan Жыл бұрын
Using href here makes the whole app reload... are you serious Angular ?
@Guptasir1993
@Guptasir1993 Жыл бұрын
Hi Angular Team, My request is to remove package.json and node modules in your next versions... As it affects in my projects as devloper we need to setup locally angular project..But it become complex ..more errors are comming My opinion,we can use angular without package.json..Just like Deno works..We move forward we can inhance performance and any body can upgrade the angular project.. Please look into these case . Thanks Aayush Gupta
@braco0000
@braco0000 Жыл бұрын
Uhmmmm... Angular getting away from being Angular...?
@balaloha
@balaloha Ай бұрын
is this AI?
Typed Forms in Angular
10:59
Angular
Рет қаралды 53 М.
What’s new in Angular v18
20:08
Angular
Рет қаралды 92 М.
Stupid Barry Find Mellstroy in Escape From Prison Challenge
00:29
Garri Creative
Рет қаралды 13 МЛН
Backstage 🤫 tutorial #elsarca #tiktok
00:13
Elsa Arca
Рет қаралды 40 МЛН
Angular Standalone Components - No Ngmodules Anymore
7:54
Monsterlessons Academy
Рет қаралды 14 М.
Getting started with Angular Signals
11:03
Angular
Рет қаралды 39 М.
ngTemplateOutlet is WAY more useful than I realised
16:36
Joshua Morony
Рет қаралды 72 М.
Angular Components Beginner's Guide
13:52
Fireship
Рет қаралды 180 М.
Deferrable views in Angularv17
6:04
Angular
Рет қаралды 20 М.
New in Angular 14 - Standalone Components and Optional Modules (2022)
25:02
More updates from Angular v18
6:03
Angular
Рет қаралды 9 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 453 М.
Why didn't the Angular team just use RxJS instead of Signals?
8:15
Joshua Morony
Рет қаралды 86 М.
Все забыли о его дне рождения 😢
0:19
Фильмы I Сериалы
Рет қаралды 2,3 МЛН
Miroşun siniri 🤣 #springonshorts #özlemlinaöz
0:18
Özlemlina Öz
Рет қаралды 62 МЛН
When Your Chiropractor Owns a Cyber Truck
0:36
Mini Katana
Рет қаралды 31 МЛН
Морская пена 🤯
0:29
FATA MORGANA
Рет қаралды 4,2 МЛН
1❤️#thankyou #shorts
0:21
あみか部
Рет қаралды 86 МЛН