News for hackers. Stuff that matters.
Re:Angular 11 by strombofulous on Thursday November 12, 2020 @07:37AM (#25069154)
Out of curiosity how long have you used angular for? I usually have similar thoughts when first picking up a new framework before working with it for a few months to figure out how it's "supposed" to be used.

(I have not used angular myself)

Re:Angular 11 by foepys on Thursday November 12, 2020 @07:46AM (#25069223)
Their observations especially on Observables is very spot-on. We have quite a few "makeObservable(input)" in our code to make @Inputs observable. That the framework doesn't do it automatically is a bit of a let down.

Same about Reactive Forms.

Patching each @Output and @Input through a component by hand is also pretty annoying, especially if they change relatively often. A custom input field for a reactive form gets quite large due to all the in- and outputs.

Re:Angular 11 by geewee on Thursday November 12, 2020 @01:48PM (#25073295)
Is there a good implementation of makeObservable() somewhere? I haven't been able to find one that seemed to work elegantly.

Patching @Output and @Input is supremely painful - I really wish there was some sort of shorthand for that.

Re:Angular 11 by foepys on Friday November 13, 2020 @01:36AM (#25079619)
I cannot share the code we use directly but we use Object.defineProperty and override the getter and setter for it, tunneling the new setted value through a behavior subject that gets returned. The getter returns the value by synchronous access to the subject.

Inputs into makeObservable are the component class (this) and the requested property name (generics with keyof).

Re:Angular 11 by geewee on Friday November 13, 2020 @01:55AM (#25079721)
Oh that's a clever way of doing it. Thanks!
Re:Angular 11 by renke1 on Thursday November 12, 2020 @07:51AM (#25069267)
Not parent, but I am using Angular for like 3 years now, I apparently have not yet figured it out. I am still baffled how hard it is to figure how to something is supposed to be used (and when do I am often shocked how it can be considered the right way…). It does not help that there a countless of Angular resources (blogs, Stack Overflow answers/questions) with low quality.
Re:Angular 11 by nicoburns on Thursday November 12, 2020 @11:09AM (#25071306)
I used Angular for ~8 months on a project. It was just about ok. Much, much better than AngularJS (Angular 1.x). But worse than React in pretty much every way. What other people have said about everything needing to be mediated by the framework was the worst bit. That and making the change detection work correctly required understanding the internals in quite a bit of detail. React's approach is slightly slower but much simpler.
Re:Angular 11 by geewee on Thursday November 12, 2020 @01:47PM (#25073265)
I've used it for a couple of months, but I've primarily been pair programming with people who have used it for years. Some of it is probably still getting used to the ropes, but I've heard many share similar sentiments about most of the things.