People continue to ask – “Should I use Angular 2 for my new project?”
What if the project doesn’t need to be ready for a few months?
What if it’s a small side project, or a proof-of-concept?
Maybe you’ve already been playing around with Angular 2 at home, but you’re stuck with 1.x at work.
At some point, it goes from “should I?” to “why can’t I?” – you want to play with the new toys! Clean component architecture, faster performance, and all the goodies that come with ES6 or TypeScript? Awesome!
How To Decide
Follow this handy flow chart:
Essentially, if this is a low-risk project (failing it won’t mean the failure of your business or something), and you’re prepared to spend some time figuring things out on your own, give Angular 2 a shot.
Just beware that it’s still alpha software, and could change massively, breaking everything you wrote. There won’t be as much help available on Stack Overflow as you’re used to with Angular 1.
To be perfectly clear, I’m not saying Angular 2 is “ready for prime time” here. You still need to weigh the risks and exercise your best judgement. Check out Is Angular 2 Ready? to see the progress toward beta.
Using Angular 2
After that, make sure you’ve got some good tutorials lined up, and dive in.
Using Angular 1
Sticking with Angular 1 for now? No shame.
There are a few things you can do to make your app easier to migrate to Angular 2 if you decide to later on:
- Start writing in ES6 or TypeScript
controllerAssyntax everywhere you can. Reduce dependencies on $scope.
- Make your app into a tree of components (one directive = one component)
- When Angular 1.5 is ready, start using its new .component syntax instead of .directive
- Until Angular 1.5, structure your directives like this:
- Check out RxJS observables as a way of wrapping $watch
Learning React can be a struggle -- so many libraries and tools!
My advice? Ignore all of them :)
For a step-by-step approach, read my book Pure React.