Like, if you like Svelte, that's great. You will probably like Angular too.
Like, if you like Svelte, that's great. You will probably like Angular too.
When I wrote Angular I spent 2 weeks on getting something similar to `props.children` working. <ng-content> didn't work if the elements were dynamic. Outlet system was way too verbose.
The 2 way databinding is anachronistic and belongs in 2010.
The i18n system they shipped with is awful. No way to have translations in code, only in template. This breaks down very fast when building generic components.
The DI relies on https://www.npmjs.com/package/reflect-metadata, which makes the builder an opaque black box unlike a webpack configuration.
Because of the opaque CLI I've spent 2 weeks figuring out why every third dev build resulted in a 150 line long tsc stacktrace, and it turned out to be angular's 1.x types package. Would have been so much easier with a webpack configuration.
Another thing is, that angular components always wrap their template into a block element (like a div) in the DOM. So if you do some refactoring and split up one big component, the result in the DOM is different and your CSS may not work anymore. If you are using flexbox or grid, it may even be impossible to split the component.
Usually if you run into problems like that, you should use templates.
Honestly, I'm not sure why `<ng-content>` exists vs templates. I'm sure there's a reason (verbosity?), but templates have way fewer caveats.
> Would have been so much easier with a webpack configuration
I agree. It's not hard at all to do a Webpack configuration of Angular. Just add the Angular plugin. (That's what the CLI does under the hood.) I wish they document it though.
The framework is extremely overengineered requiring multiple files for "hello world"
It introduces a lot of unnecessary complexity for projects of any size
It uses invalid HTML, with attribute syntax including brackets and parentheses
Sadly It's just not a good framework
It's my answer to what I can tell you agree is the most important question in software engineering - "What programming language has the shortest 'Hello World' program?"
Problem is, this doesn't lead me to solve any harder problems.
That's not even a criticism of the framework.
Is that a valid criticism?
Angular is for writing medium to heavy complexity applications. Sure, if you want to write hello world programs in it, then it is going to be complex.
This is a generic comment thrown about for all large frameworks.
> It introduces a lot of unnecessary complexity for projects of any size
This I agree.
> It uses invalid HTML, with attribute syntax including brackets and parentheses
True, but so does React and other frameworks. To me, it seems like this is a limitation of HTML rather than a transgression of Angular.
> Sadly It's just not a good framework
It is a good choice for a large organization, with team members changing and all sorts of other goodness.
> requiring multiple files for "hello world"
False (unless you're counting angular.json conf file for Angular CLI??)
> It uses invalid HTML, with attribute syntax including brackets and parentheses
And what, JSX is valid HTML????
FWIW Angular templates is completely valid HTML. (The only non-standard thing is that the attributes are case-sensitive.)
JSX makes so much more sense, making code the parent of the template, instead of keeping code and template as siblings.
I note that Vue and Svelte have the same issue, and yet I rarely hear this criticism of them.
Brackets and parens are valid in attribute names.
Section 13.1.2.3 of the HTML standard[0] states:
> Attribute names must consist of one or more characters other than controls, U+0020 SPACE, U+0022 ("), U+0027 ('), U+003E (>), U+002F (/), U+003D (=), and noncharacters.
One of my major annoyances is the templating language. Completely unnecessary and over complicated, compared to JSX. Just another weird syntax to learn with its own arbitrary limitations and quirks.
I think it’s a good indicator of the overengineering surrounding Angular overall.
With Angular templates, there's an entire new language, with its own weird syntax ngIf/else, ngSwitchDefault, let-*, pipes and other components that get pulled in based on whether you forgot to set up correctly or not in modules far-far away somewhere in the codebase, brackets of different sorts having different functions and just a lot more stuff to remember. And if it doesn't work, you're gonna get a silent error most of the time with no easy way to set a breakpoint to investigate.
I also don't believe there's any real separation between the HTML templates and the Component class, just because they're written in separate files. They're just as tightly coupled as any regular React component, just harder to follow. I don't think I've ever seen an Angular component, where you could swap out the template, without making simultaneous changes to the Component to accommodate it, which should be possible if they were truly separate.
Angular requires a lot of extra steps to get the templates properly type-checked (and you even need an editor plugin for that). I can't even name which non-standard entries in the tsconfig are necessary to have all templates checked entirely.
Most people use the cli to generate new components. Where in other frameworks, you just create a new file, maybe use a snippet and call it a day, the cli yields a test, scss, html and the actual component code as separate files.
Having worked with angular and react for 5 years in parallel, I'm pretty certain that I'd never touch angular again. The DX is so complicated in comparison. Despite forcing you to use TypeScript, angular is the framework that benefits the least of it.
Other frameworks have already loaded dependent REST/GraphQL data before Angular has even initialized.
Take someone on a mobile device and put them at the edge of cell signal range either because they're out an about or stuck in the bowels of a building with thick walls. Suddenly 275KB-3MB matters a lot more and the user is staring at a blank screen for 10+ secs.
Then there's the boilerplate, all the metadata you need to add to each component that has nothing to do with your problem domain.
And then there's runtime speed compared to alternatives.
While I'm truly happy to see Angular incorporate signals, now devs need to learn when to use signals rather than rxjs. I know now that it's the difference between needing async or not, but if you go down one path, it's a PITA to tear it down and rewrite for the new path.
THAT's why I don't like Angular, though I'd happily choose Angular over React and Vue, both of which are a prone to reducing codebases to big balls of mud due to their "flexibility".
ng serve for development is a pig too. Save-reload cycle is far from instant.
The React ecosystem also improves faster (yes, sometimes a bit too fast).
A big part of maintainability comes from the quality of code and/or existing experience with the two frameworks, not the frameworks itself.
I work at an Angular only shop, if we would write some React it would be probably harder to maintain for us than the Angular ones.