Angular, maintained by Google and one of the most powerful web development frameworks out there, is a pretty good choice for web development. To help you decide whether Angular is good for you, here's a list of Angular pros and cons.
Note: We are talking about Angular (2-12), NOT Angular.js.
TL;DR
Scroll to the end of the post for a summary if you don't want to read the whole thing.
Pros
- Angular sites are Single Page Applications (SPA). SPAs allow us to load new pages without requesting the server, giving a more dynamic and interactive experience. For example, GMail is a SPA.
- Angular is feature-packed. State? Baked in. Reactivity? Baked in. Routing? Baked in. DI? Baked in. Services? Baked in.
- Angular is cross-platform.
- PWAs: Use modern web platform capabilities to deliver app-like experiences. High performance, offline, and zero-step installation.
- Native: Build native mobile apps with strategies from Cordova, Ionic, or NativeScript.
- Desktop: Create desktop-installed apps across Mac, Windows, and Linux using the same Angular methods you've learned for the web plus the ability to access native OS APIs.
- Angular **optimizes your templates into code that's highly optimized for today's JavaScript virtual machines, giving you all the benefits of hand-written code with the productivity of a framework.
- Angular has automatic code-splitting so users only load code required to render the view they request.
- Angular uses TypeScript, which provides better tooling, cleaner code, and higher scalability.
- Angular is productive. It provides all the tools you need to scaffold apps and components. Angular provides a handy CLI which can generate production-ready apps and components with a single command.
- Angular's MVC Architecture makes it easy to separate styles from logic from markup.
- Angular has a flexible templating system which supports 1 or 2-way binding, pipes, custom structural directives, and more.
- Angular has built-in support for Services and Dependency Injection (DI). This further separates the business logic from your components, which provides cleaner code.
- Angular sets up testing frameworks automatically. With Karma for unit tests, you can know if you've broken things every time you save.
- Angular has a built-in animation API for high-performance, complex choreographies and animation timelines with very little code.
- Pre-render Angular with Angular Universal and serve the first view of your application on Node.js, .NET,
PHP
, and other servers for near-instant rendering in just HTML and CSS. Also paves the way for sites that optimize for SEO.
Cons
- Angular is a SPA, so it has limited SEO capabilities. But, you can prerender Angular using Angular Universal.
- Angular has a steep learning curve, But it's worth the effort, as Angular is super powerful.
- Angular is complex and verbose, so it's not really suitable for small apps. It's designed for complex systems.
- Angular has a (kind of) low ranking on some developer surveys. On The State of JavaScript, Angular has high negative opinions. On the Stack Overflow developer survey, Angular is the ninth most loved developer framework, behind React and Vue, which are at 2nd and 3rd place. Angular is the 8th most dreaded web framework, and it's the third most wanted web framework.
Summary
Angular is a powerful framework if you are willing to spend time and effort learning it. It has all sorts of features like DI, Services, Components, and more, but its SPA nature makes it bad at SEO. It's also not the most popular framework, owing to its steep learning curve. It's also highly focused on scalability.
Use Angular if you are building large, complex applications that should be scalable and modular.
Don't use Angular smaller apps which don't need all the complexity Angular provides. Don't use them for static sites, because of the accessibility problems and over complexity.
Top comments (8)
Not sure why you're commenting this, because the author didn't say most of these things in the article.
Actually, I think the conclusion is pretty accurate without going into "opinions" too much. Information like this should be on the front page of each library or framework, and we would have less unnecessary framework "wars".
I like it that the author is honest not just about the pros, but also about the cons of Angular - brutally honest even, with clear advice on when to use it and when not to use it. So many articles are written as advertisements for the author's favorite tool or framework, this article is not one of them.
Thanks!
The State of JavaScript has grouped AngularJS and Angular together, which explains the negativity. It's like grouping React and Ember together; it makes no sense, they are different frameworks 🤷♂️
Not in the most recent one.
Makes sense! In the Stack Overflow survey, they were separated, and Angular.js had a really low ranking.
Angular2 is more of MVVM other than MVC in my opinion.
The 2 biggest pros for me is the singleton design pattern in Angular2 (Services Injection) and the MVVM arc. Of-course these 2 could be applied also with react for example - but these 2 come built in
I wrote this list mainly from a Vanilla JavaScript Developer point of view, maybe that's why it seems biased.