I realize a lot of companies flocked to Angular and it's used in a lot of places, but from the outside it seems to be fighting on two fronts.
1. Companies currently implementing it not wanting it to change or for there to be a quick and painless migration from 1.x to 2.x. So, less change, more hand-holding. The web changed a lot though, so its change is understandable.
2. Trendsetters and upcoming companies looking for something new fresh and solid: Framework competition from React and the like. Maybe that second group is a lot louder in certain circles, startup-y hackernews being one, but it sounds like Angular will eventually reside in the shadow of React if it stays that way for long. Google pulling the plug on things fairly commonly doesn't help with the uncertainty.
Just seems like anytime Angular comes up in conversation, React isn't far behind. This post is no exception I guess, I just can't see Google maintaining Angular if it becomes Dojo in the eyes of developers.
React and Angular are two very different experiences.
Using Angular 2 with TypeScript is almost like using WPF and C# on the desktop - it has that enterprise framework feeling - hierarchical DI everywhere, everything out of the box (DI, routing, events, forms, etc.), classes and OO are the foundation, decorators, even "functional" parts adopts RX from .NET. Using Dart gets you even more stuff working "out of the box" with a functional package manager and build system but it seems like that language might be a dead end so TS is a safer bet. Tooling provided powered by TS is top notch.
React is much more of a JS approach - sure the core library is smaller but in the end you throw in a bunch of libraries to compose your own framework and you're stuck with good old JS decision hell (should I use redux, which routing lib, etc.) - this may be an advantage if you you have a bunch of front end devs that like to sink time in to exploring the ecosystem and chasing the latest fads to keep up to date with what's being supported - but if you need a library to give to your corporate C#/Java devs angular would be my go-to. Coding styles are classic JS mix-and-match pseudo functional + pseudo OO.
Angular 2 feels slightly over-engineered but at the same time I'm more comfortable with this approach - even after using clojure full-time for 2 years - react feels too messy both from a functional/OO and ecosystem standpoint.
We've been slowly migrating https://splice.com from Angular 1 to Angular 2, so far it's been great. We switched to TypeScript, we cleaned up our code organization. We are writing new components in ng2 and migrating old code we we go. The betas have been somewhat painful with bugs and breaking changes, but that's the price to pay. When it comes to performance and consistency, ng2 is a big winner. Why not React you might ask? React is great, but having to figure out/argue for each piece of the frontend stack isn't something we were willing to do. ng2 has its quarks bug at least it comes as a whole and that's super useful for us at this moment.
Lots more work to do here, but we're pretty happy with how the core looks! For those worried about size (which has absolutely been a fair concern over the alpha/beta process) - here's a "hello world" built with Rollup and our offline template precompilation. Clocks in at 200kb min/47k gzipped, with a bit more room from optimization over the next couple of weeks... https://ng2-compiler-test2.firebaseapp.com/
(yes, I know it's not the same under the covers - take it as a comment on the ecosystem, not on the implementation (although it can be a comment on dead code detection too))
I spent a whole bunch of time learning Angular1, was in a coma for close to a year after a bad accident, wake up and find my projects are all outdated and I have to basically learn a new framework. Decided if I was going to learn a new framework it was going to be something not made by google. React was simple to learn, unlike Angular. Everything you do in angular requires you to learn the "angular way", once you can create components and understand flux react is fairly straight forward and doesn't require you to re-learn web development.
I will go a totally other route than upgrading. I mean wtf. the JavaScript Part of Angular 2 is horrible.
Since I'm on a Scala Server I possible try to look at Scala JS and rewrite something.
It's too bad that our "application" fit's the SPA scheme so good, but these frameworks changes so much over the years that it's nearly not maintainable will a small group.
Unless you hate yourself I think it's best to with Typescript for Angular2. It is more natural with classes, and less verbose in the long run than vanilla js. Also you will find more documentation and tutorials geared towards the Typescript version.
No problem. People like you have to stick with the old stuff because of this mindset.
I mean WTF is bugging you? It's just code you have to write in order to get the thing running.
You could also complain about the empty object in the angular1 method.
Since Angular 2 is so different from Angular 1 and there is not a universal solution to upgrade from 1 to 2, do you think there would have been a better PR/current user reaction if it was named something else?
I hear a lot about angular and that it has gotten quite a competition from react, aurelia and vue.
I personally will never use react. but i want to know, in which situations, it would be better to use angular and in which situations it would be better to use aurelia or vue.
One thing that interests me about Angular 2 a bit more than React is the web components support.
With web components finally going native (surprisingly, led by Safari!), will Angular 2 see any big speedups, and will the size of the hello world app come down (200k is kind of huge)?
Also, I've seen a few tutorials on using Angular 2 with Polymer, but it seems complex. Is Google working on making these work together better? Will I be able to create Angular 2 web components and use them with Polymer web components?
When I looked at the Angular 2 beta a couple of months ago, you needed to add es6 shim, angular 2 polyfills, systemjs and rxjs as well as Angular 2, just to get up and running and have a basic Hello World.
Contrast this to Angular 1, where the library on it's own with no dependencies will suffice.
Is this still the case? Are there plans to package Angular2 as a single minified GZipped library?
Are you going to maintain Angular 1.x for the years to come? Because Angular 2.x is a completely different framework and upgrading doesn't make much sense to me.
I'm looking forward to trying this out. Having written Ember, Angular, and React apps now, I feel like they are all getting closer, but a lot of rough edges still exist.
Ember: interesting framework, but all too often, you would hear a team mate say "wait, why is that working, it shouldn't be?" Mixed with equal parts "logically, that SHOULD work, what am I missing?"
React: I love the component focus, and redux is pretty slick. However, the insistence on using JavaScript in lieu of helpful abstractions that clean up the code for easier maintainability, is frustrating. The whole point of JSX is syntactical sugar, but the team went with half measures. You also end up with a lot more plumbing code than the other two. Sure, I can reuse some of these components, but in truth, most of your components will be single use.
Angular 1: by far the easiest and most intuitive. Enough magic to make setup and a basic app easy, but not so much magic that you can't figure out why something is working. However, the more complex an app, the less Angular 1 serves. And you really need to use directives as a component, and follow a more react pattern, or you're going to have a bad time. Also, the dependency injection is a nice thought for simple directives, but when you're done, you'll very likely have so many dependencies being injected that unit testing becomes burdensome. And if it's burdensome, it won't be done as much as needed.
All that being said, if your app is primarily collecting data through forms, you can't beat angular. If it's highly dynamic, and you want a more native feel to your app, react is the clear winner. Ember is a neat, but I won't be using it again.
Angular 2 doesn't fix all of my complaints, but it's getting closer.
> However, the more complex an app, the less Angular 1 serves.
That's not really true.
The problem is that all three frameworks are supposed* to require the same discipline when it comes to managing state, but only React forces that discipline onto the developer.
I'm not saying React is better, but learning from React is important to be able to write maintainable applications in any framework. You don't want to have 30 services, each services managing there own little state in AngularJS for instance. Unfortunately that's usually what happens when an app grows with time.
Angular2 does seem to get rid of the dirty checking, allowing better performances. It also has a good router. But does it really bring something new in terms of view layer and state management, considering the cost ?
I like Angular1, it's one js file you drop in an HTML page, no need for nodejs, NPM, a third party language and what not. And it's mature. It's absolutely unfortunate that Angular2 basically forces developers to use Typescript. That's a huge mistake IMHO.
I'm coming at this from the perspective of someone who has never used Angular 1.x or 2.x.
I guess the first thing on my mind is: can I make Angular 2 work just like React does? Is there any way to use it without making/(being allowed to make) separate HTML templates and CSS files? If not, this is a serious disadvantage. Having the view layer scattered across 3X the files (vs React) would make it very hard to follow the code in a large project.
Also, are there any real advantages over React that would be big enough for someone to consider pushing for a switch? If so, what are they?
I read something a while ago that I think really sums the key difference, is that angular and other frameworks inject javascript into html and its awkward. React injects HTML into javascript, and it seems, that way around is a lot more powerful as you have all of javascript to manipulate html rather than having HTML/Templating/Extensions to manipulate Javascript.
The two advantages are speed (it's supposed to be faster) and its closer to the web component standard than react, so if/when web components become mainstream it could be a lot easier migrating from angular2. However, both of those wouldn't be my prime reasons for choosing a framework though.
One can use the @Component decorator with the template & style options - currently it seems to be the norm to do so, at least until the template compiler is understood more widely (it is pretty fresh), although long term having the template and styles in the same file probably will not be sustainable for more complex components.
Angular 2 has some serious perf advantages over anything else out there, reportedly up to 2x React in some scenarios (i.e. repaint perf). It also is set up for incremental rendering, as opposed to React's blocking rendering loop, which can allow for more flexible UX. With the new bundling system for Angular 2, I believe it is currently a fraction of the size of React (I think the Angular team achieved < 10 KB app framework size, although I haven't checked out the new npm packages to be sure).
React wins out on simplicity though, including how simple it is to communicate between components. React is also currently a lot more mature, with a much more mature third party ecosystem.
Edit: I stand corrected on the size, but the 10 KB minified & gzipped is the Angular team's goal I remember reading.
"Is there any way to use it without making/(being allowed to make) separate HTML templates and CSS files? If not, this is a serious disadvantage"
Translation:
"Can I sh*t where I eat? If not, this is a serious disadvantage"
I'm happy to see Angular2 getting closer to a release, and as many other companies we are in the case of what decision after Angular1.
One thing I think will be a great push for Angular2 is Ionic2 which alone is reason enough but to be honest I prefer the `Aurelia way` when it comes to writing web apps which sounds more natural, Sad to see Aurelia hype haven't took much so far (understandable that it's getting harder to get people on board a new `revolutionary` JS framework).
I too like the look of aurelia. However, I really like the auto import management, refactoring, syntax highlighting. I use Webstorm & didn't see any blog posts or anything about how to set up Webstorm with Aurelia. So I'll go on learning Angular 2 for now.
Saw references to rc0 in the angular2-seed earlier - wasn't too sure what to make of that, as I still saw the beta in the main repo.
"This is the first release candidate that contains repackaging of Angular into individual packages one per each feature area. ... This changes how Angular is installed via npm and how you import the code"
This seems like a pretty big change to include as part of the first RC??
When I read up about Angular 2 a year ago or so, based on my very shallow understanding it seemed like the perfect combination of the automagics of Angular 1, and the light-weightedness of React. But what do you JS folks think about this?
What gave you the impression of light-weightedness though? My understanding was that Angular 2 is aiming at being a fully featured (and thus heavy) framework.
Isn't it ironic that, as we are moving away from fat servers, we are now writing even fatter clients ( which still need a server since one wants in many case to be able to render pages server side and one has to serve static assets anyway ) .
So what is the concrete difference between an API + a node-js server to serve assets and render templates server-side (so with a lot of business logic) + an angular2 client written in typescript , all this VS something like Rich Faces or Prime Faces in a servlet container ? We just rebuild the exact same thing that is hated by most "modern developers", with worse tooling on top of it. Both solutions need a third party language that is not Javascript, both solutions need a compilation step, and command line tools(or an IDE in the case of Java).
Some will say "Well, now the client and server are independent, and if the server changes, one can keep the fat client". But in practice, which side gets rewritten ? the server or the client with the "framework du jour" ?
I just love how the same people that called me the devil for using WPF back when .NET 3 came out are now calling me about angular with 'have you heard about this new and exciting paradigm?'...
Aurelia (http://aurelia.io) is the ONLY framework that I have seen where you DON'T see the framework when you look through the code. You see YOUR app and YOUR logic. To me this is incredibly important for the longevity and simplicity of your code base. Please people, do yourselves a favor and checkout Aurelia.
Half off topic but I want just to add that Webstorm IDE has already quite a good NG2 support. For example you can jump from html to a component function via F12 or auto import unresolved statements.
You see VS Code on many NG2 presentations. I think Webstorm helps more getting quicker into NG2. Also Angular-CLI helps a lot.
I mention this here because many people seem to struggle with the boilerplate code.
WebStorm has been pretty amazing in keeping up with us, a fair number of our team use it. Even more exciting is upcoming tooling integrations we'll get from Typescript - there's a cool GIF in this issue tracking the work https://github.com/Microsoft/TypeScript/issues/6508
[+] [-] jalami|10 years ago|reply
1. Companies currently implementing it not wanting it to change or for there to be a quick and painless migration from 1.x to 2.x. So, less change, more hand-holding. The web changed a lot though, so its change is understandable.
2. Trendsetters and upcoming companies looking for something new fresh and solid: Framework competition from React and the like. Maybe that second group is a lot louder in certain circles, startup-y hackernews being one, but it sounds like Angular will eventually reside in the shadow of React if it stays that way for long. Google pulling the plug on things fairly commonly doesn't help with the uncertainty.
Just seems like anytime Angular comes up in conversation, React isn't far behind. This post is no exception I guess, I just can't see Google maintaining Angular if it becomes Dojo in the eyes of developers.
[+] [-] rubber_duck|10 years ago|reply
Using Angular 2 with TypeScript is almost like using WPF and C# on the desktop - it has that enterprise framework feeling - hierarchical DI everywhere, everything out of the box (DI, routing, events, forms, etc.), classes and OO are the foundation, decorators, even "functional" parts adopts RX from .NET. Using Dart gets you even more stuff working "out of the box" with a functional package manager and build system but it seems like that language might be a dead end so TS is a safer bet. Tooling provided powered by TS is top notch.
React is much more of a JS approach - sure the core library is smaller but in the end you throw in a bunch of libraries to compose your own framework and you're stuck with good old JS decision hell (should I use redux, which routing lib, etc.) - this may be an advantage if you you have a bunch of front end devs that like to sink time in to exploring the ecosystem and chasing the latest fads to keep up to date with what's being supported - but if you need a library to give to your corporate C#/Java devs angular would be my go-to. Coding styles are classic JS mix-and-match pseudo functional + pseudo OO.
Angular 2 feels slightly over-engineered but at the same time I'm more comfortable with this approach - even after using clojure full-time for 2 years - react feels too messy both from a functional/OO and ecosystem standpoint.
[+] [-] mattetti|10 years ago|reply
[+] [-] ihsw|10 years ago|reply
If it's more than copy-pasta then I doubt it will be received well.
And #2 is spot on -- React is eating Angular's lunch. I'd love to use it at work but I can't, and I don't think I'm the only one.
[+] [-] robwormald|10 years ago|reply
[+] [-] viraptor|10 years ago|reply
[+] [-] cetra3|10 years ago|reply
https://github.com/rollup/rollup/issues/280
Do you rollup angular or is it still an external dependency?
[+] [-] ErikAugust|10 years ago|reply
Honestly, there is so little continuity that you have the option of just switching to React.
Or perhaps, just maintaining your Angular 1 app - and then assuming the 1.x fork will be carried on for a long time.
[+] [-] zxcvcxz|10 years ago|reply
That's what I did :)
I spent a whole bunch of time learning Angular1, was in a coma for close to a year after a bad accident, wake up and find my projects are all outdated and I have to basically learn a new framework. Decided if I was going to learn a new framework it was going to be something not made by google. React was simple to learn, unlike Angular. Everything you do in angular requires you to learn the "angular way", once you can create components and understand flux react is fairly straight forward and doesn't require you to re-learn web development.
[+] [-] merb|10 years ago|reply
[+] [-] hmottestad|10 years ago|reply
[+] [-] SeriousM|10 years ago|reply
[+] [-] robwormald|10 years ago|reply
[+] [-] mchaver|10 years ago|reply
[+] [-] rk06|10 years ago|reply
I personally will never use react. but i want to know, in which situations, it would be better to use angular and in which situations it would be better to use aurelia or vue.
[+] [-] glass-animal|10 years ago|reply
With web components finally going native (surprisingly, led by Safari!), will Angular 2 see any big speedups, and will the size of the hello world app come down (200k is kind of huge)?
Also, I've seen a few tutorials on using Angular 2 with Polymer, but it seems complex. Is Google working on making these work together better? Will I be able to create Angular 2 web components and use them with Polymer web components?
[+] [-] jmkni|10 years ago|reply
When I looked at the Angular 2 beta a couple of months ago, you needed to add es6 shim, angular 2 polyfills, systemjs and rxjs as well as Angular 2, just to get up and running and have a basic Hello World.
Contrast this to Angular 1, where the library on it's own with no dependencies will suffice.
Is this still the case? Are there plans to package Angular2 as a single minified GZipped library?
Thanks
[+] [-] wooptoo|10 years ago|reply
[+] [-] symlinkk|10 years ago|reply
[+] [-] dgabriel|10 years ago|reply
[+] [-] notsotrue|10 years ago|reply
Ember: interesting framework, but all too often, you would hear a team mate say "wait, why is that working, it shouldn't be?" Mixed with equal parts "logically, that SHOULD work, what am I missing?"
React: I love the component focus, and redux is pretty slick. However, the insistence on using JavaScript in lieu of helpful abstractions that clean up the code for easier maintainability, is frustrating. The whole point of JSX is syntactical sugar, but the team went with half measures. You also end up with a lot more plumbing code than the other two. Sure, I can reuse some of these components, but in truth, most of your components will be single use.
Angular 1: by far the easiest and most intuitive. Enough magic to make setup and a basic app easy, but not so much magic that you can't figure out why something is working. However, the more complex an app, the less Angular 1 serves. And you really need to use directives as a component, and follow a more react pattern, or you're going to have a bad time. Also, the dependency injection is a nice thought for simple directives, but when you're done, you'll very likely have so many dependencies being injected that unit testing becomes burdensome. And if it's burdensome, it won't be done as much as needed.
All that being said, if your app is primarily collecting data through forms, you can't beat angular. If it's highly dynamic, and you want a more native feel to your app, react is the clear winner. Ember is a neat, but I won't be using it again.
Angular 2 doesn't fix all of my complaints, but it's getting closer.
[+] [-] spriggan3|10 years ago|reply
That's not really true.
The problem is that all three frameworks are supposed* to require the same discipline when it comes to managing state, but only React forces that discipline onto the developer.
I'm not saying React is better, but learning from React is important to be able to write maintainable applications in any framework. You don't want to have 30 services, each services managing there own little state in AngularJS for instance. Unfortunately that's usually what happens when an app grows with time.
Angular2 does seem to get rid of the dirty checking, allowing better performances. It also has a good router. But does it really bring something new in terms of view layer and state management, considering the cost ?
I like Angular1, it's one js file you drop in an HTML page, no need for nodejs, NPM, a third party language and what not. And it's mature. It's absolutely unfortunate that Angular2 basically forces developers to use Typescript. That's a huge mistake IMHO.
edited
[+] [-] zxcvcxz|10 years ago|reply
I appreciate this. The javascript world already has too many abstractions.
>Angular 1: by far the easiest and most intuitive.
How on earth do you find Angular more intuitive than React?
Angular is a behemoth compared to React. This is like saying Rust is easier and more intuitive than Go.
Angular 2 forced me to switch to React because it made me weary of Angular 3 and the new abstractions that that will bring.
It seems also that a lot more big sites are choosing react over angular and I see a lot more job postings for react devs.
[+] [-] maxharris|10 years ago|reply
I guess the first thing on my mind is: can I make Angular 2 work just like React does? Is there any way to use it without making/(being allowed to make) separate HTML templates and CSS files? If not, this is a serious disadvantage. Having the view layer scattered across 3X the files (vs React) would make it very hard to follow the code in a large project.
Also, are there any real advantages over React that would be big enough for someone to consider pushing for a switch? If so, what are they?
[+] [-] keithnz|10 years ago|reply
The two advantages are speed (it's supposed to be faster) and its closer to the web component standard than react, so if/when web components become mainstream it could be a lot easier migrating from angular2. However, both of those wouldn't be my prime reasons for choosing a framework though.
[+] [-] Bahamut|10 years ago|reply
Angular 2 has some serious perf advantages over anything else out there, reportedly up to 2x React in some scenarios (i.e. repaint perf). It also is set up for incremental rendering, as opposed to React's blocking rendering loop, which can allow for more flexible UX. With the new bundling system for Angular 2, I believe it is currently a fraction of the size of React (I think the Angular team achieved < 10 KB app framework size, although I haven't checked out the new npm packages to be sure).
React wins out on simplicity though, including how simple it is to communicate between components. React is also currently a lot more mature, with a much more mature third party ecosystem.
Edit: I stand corrected on the size, but the 10 KB minified & gzipped is the Angular team's goal I remember reading.
[+] [-] bdcravens|10 years ago|reply
[+] [-] iSnow|10 years ago|reply
[+] [-] balamaci|10 years ago|reply
[+] [-] thomas-b|10 years ago|reply
One thing I think will be a great push for Angular2 is Ionic2 which alone is reason enough but to be honest I prefer the `Aurelia way` when it comes to writing web apps which sounds more natural, Sad to see Aurelia hype haven't took much so far (understandable that it's getting harder to get people on board a new `revolutionary` JS framework).
[+] [-] codecamper|10 years ago|reply
[+] [-] rk06|10 years ago|reply
[+] [-] bdcravens|10 years ago|reply
"This is the first release candidate that contains repackaging of Angular into individual packages one per each feature area. ... This changes how Angular is installed via npm and how you import the code"
This seems like a pretty big change to include as part of the first RC??
[+] [-] oolongCat|10 years ago|reply
I am honestly intrigued as to what Angular2 offers, that other JS frameworks wont?
[+] [-] jmkni|10 years ago|reply
If your Angular 1 code is working well, doing any of the above would be stupid.
As far as I'm concerned, new JS frameworks are options for new projects, not existing ones.
[+] [-] dbbk|10 years ago|reply
[+] [-] dudus|10 years ago|reply
In my point of view react is easier to use while angular is better for testing.
My personal choice is angular. I'm really excited for v2. But both are super powerful.
[+] [-] rk06|10 years ago|reply
[+] [-] samuell|10 years ago|reply
[+] [-] romankolpak|10 years ago|reply
[+] [-] spriggan3|10 years ago|reply
So what is the concrete difference between an API + a node-js server to serve assets and render templates server-side (so with a lot of business logic) + an angular2 client written in typescript , all this VS something like Rich Faces or Prime Faces in a servlet container ? We just rebuild the exact same thing that is hated by most "modern developers", with worse tooling on top of it. Both solutions need a third party language that is not Javascript, both solutions need a compilation step, and command line tools(or an IDE in the case of Java).
Some will say "Well, now the client and server are independent, and if the server changes, one can keep the fat client". But in practice, which side gets rewritten ? the server or the client with the "framework du jour" ?
[+] [-] JustSomeNobody|10 years ago|reply
[+] [-] qaq|10 years ago|reply
[+] [-] MrDosu|10 years ago|reply
[+] [-] Wintamute|10 years ago|reply
[+] [-] ejsmith|10 years ago|reply
[+] [-] doczoidberg|10 years ago|reply
[+] [-] robwormald|10 years ago|reply
[+] [-] bdcravens|10 years ago|reply
I admit I've been a bit nervous about angular-cli calling itself still in alpha - probably a good time to take a look at it
[+] [-] rk06|10 years ago|reply