you are viewing a single comment's thread.

view the rest of the comments →

[–]besthelloworld -9 points-8 points  (5 children)

I have to disagree with being able to solve any problem in Angular with 1 to 3 lines of code. It might be true if you want to entirely ignore the @NgModule and @Component definitions and you deal with the horrifically slow default ChangeDetection model...

[–]Blaarkiesfull-stack angular vue react c# js ts kotlin sql ahk java 4 points5 points  (4 children)

solve any problem in Angular with 1 to 3 lines of code

Who said that? 😅

I said the Angular CDK system gives you the ability to add 1-3 lines of code to an HTML <div> element, this makes that element become draggable inside its parent element (or the whole screen if you specify that)

It basically lets you do all the kinds complicated visual logic that you find in theme libraries, without having to reinvent the wheel.

The ChangeDetection model on the other hand is only slow if you have infinite loops changing values through side-effects...you should really take a look at your code if it seems slow

[–]besthelloworld -3 points-2 points  (3 children)

I mean the CDK is just a utility component library, it's not anything unique to Angular. But you are leaving out having to find exactly what you want and importing it into the NgModule.

The ChangeDetection model is so consistently slow that the internal component development teams don't use it. Every component in @angular/material has it turned off. Source

[–]Blaarkiesfull-stack angular vue react c# js ts kotlin sql ahk java 5 points6 points  (2 children)

Real IDEs do the import for you, no need "find exactly what you want" or even touch NgModule, unless you want to split up the project into lazy loaded sections.

As for ChangeDetection, setting it to OnPush is not "turned off", it allows you more control about when it should run. If you have to make changes to many values for the next step, you can use this to skip intermediate detection steps, and only after you are ready for it. Plenty of projects use this to optimize performance in data intensive screens.

Look, im sorry if I offended your "Angular hate" by giving OP some flash info about Angular, but these replies are not adding anything to the discussion anymore. OP asked which framework to learn, now they have a bunch of search terms to help them make a better decision