
Loading Components Dynamically in Angular 2 - thelgevold
http://www.syntaxsuccess.com/viewarticle/loading-components-dynamically-in-angular-2.0
======
lukealization
What's the general consensus on Angular 2? I've built a few apps with it, and
generally like it, although it's quite opinionated.

Most of the time I've seen something Angular-related appear on HN, there's
generally a facet of the community lambasting it as too big/too enterprisey.

~~~
Bahamut
As someone leading development of a non-trivial product in Angular 2 (team of
8-10 engineers, 2 QA, has varied some with resource shifting) with having to
solve some tricky problems (drag and drop, web audio for playback, audio
recording, etc., I have found using Angular 2 a mixed experience, if generally
positive.

Performance is pretty much phenomenal - for those who put in the work to
optimize via build toolchain config and code, there are a lot of areas where
Angular gives you room to implement improvements. Observables also allow very
clean push-based reactive component systems, avoiding the need for
unintentional changes most of the time - lifecycle hooks help you with the
rest.

Implementing AOT compilation to avoid shipping the whole Angular compiler to
the runtime is super painful though - it is easily one of the most frustrating
experiences for a developer to do currently. I find TypeScript to be a mixed
bag - it doesn't let you go all out on FP, mostly due to its flaws in typing
with function composition. Testing can be slow due to the compilation of
everything via the TypeScript compiler & Webpack (the interlay between the two
might be the culprit). Stack traces are sometimes mysterious - I spent a
couple of minutes debugging a failure from a test I wrote that resulted in an
ambiguous stack trace...all because I forgot to spy on my function.

Personally, I think I would enjoy creating an app in React more, but I do
notice significant productivity gains for my team with Angular 2 and
TypeScript, and better code design.

I am probably one of the biggest experts in Angular 1 outside Google out
there, and pretty knowledgeable in Angular 2, although not as sharp since I
have moved into management currently, if that helps give some context.

~~~
nickik
> but I do notice significant productivity gains for my team with Angular 2
> and TypeScript, and better code design.

Compared to a React/Redux whatever team or what do you mean?

~~~
gshulegaard
For a couple of years I had done full stack work on an e-learning application
that when from Ember to Angular. For the last year and a half though I have
been working specifically in backend.

Recently I started doing some light work with React and I think the biggest
difference between Angular 1 (even Ember to some extent) and React that I have
found is Flux
([https://facebook.github.io/flux/](https://facebook.github.io/flux/)).
Technically Flux is a "pattern" but I believe it is more or less required if
you plan to do a non-trivial application in React.

I won't give an opinion about it since I haven't really worked long enough
with React to really do so, but I thought I would mention it for you to
consider.

------
huula
Looks cool! Sometimes I think incremental initialization will be the ultimate
performance optimization strategy, and this is definitely a great way to
achieve that!

For the debate on ng2, I have been using ng2 to build Huula for about a year,
which has some amount of ng2 code. So here are my two pennies for folks who
are considering using it. I don't like to be constrained by a framework, so
angular's routing system always stands on my way (including ng1), so I ditched
angular routing entirely. I never used angular's inline styles either, for me
sass works better. Ng2's change detection can be stupid sometimes, especially
for stuff similar to drag drop, but there are solutions to those cases,
although a bit clumsy and convoluted, so be careful .

