(no title)
snemvalts | 2 years ago
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.
andix|2 years ago
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.
paulddraper|2 years ago
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.
snemvalts|2 years ago