If you've been coding at all recently, you've most likely come across Angular in your streams- and for good reason. While it's incredible that Google and a massive community of developers are already evangelizing it, we have another 15 reasons for loving AngularJS.
- Modular and component-driven. With AngularJS we can write and organize our code into “modules” which makes for cleaner, more flexible codebases. Gone are the days of massively confusing reams of jQuery spaghetti code; AngularJS brings organization and coding principles to keep things fast and maintainable.
- D.R.Y. and reusable code made easy! DRY or “don't repeat yourself” is an acronym that every developer should live by. Angular's modular nature makes it incredibly easy to write and reuse code. Frequently interfacing with various API's or find yourself rewriting similar functionality from project to project? Angular has your back.
- Two way data binding is legendary! When Angular first hit the news, two-way data binding was arguably one of the better known and exciting features of the framework. In typical MVC frameworks, we store data in the model and present it in the view. This is great for organization, however you soon end up with tons of boilerplate code for updating values in the model based on user interaction and in the view based on business logic. Angular saves developers so much time with it's free, built-in two-way data binding. In a nutshell, this means values in your view are tightly bound to the data source so that when a user interacts and updates a value, guess what, your model is updated too! You can see this in action on our ClickTackle Headline Generator.
- Directives FTW! Angular's directives are a blessing and developers around the internet have fallen in love. Angular is all about separation of concerns and provides an extremely powerful design pattern for interfacing with the DOM. All DOM manipulation should be performed in directives leaving controllers to business logic. Directives allow us to package up reusable chunks of DOM based code and initialize directly within HTML templates using data attributes and custom elements. Angular also comes with a heap of directives built in, including the ng-click directive that binds click events to a method within that elements scope. Another directive, the super powerful ng-repeat, will loop through an array in your model, duplicating the element it's attached to with the appropriate data for each item filled in.
- Services are pretty damn awesome! The concept behind Angular's services is to provide a mechanism for creating libraries and reusable classes that can be shared between controllers and directives alike. Factories (singletons), services (instantiable classes), values (simple injectable value) and constants (simple injectable values that cannot be changed) are all at the developers disposal. The makers of AngularJS also packed the framework full with a huge collection of core services, $http (AJAX), $resource (REST), and $location (routing) to name just a few.
- Dependency Injection. Dependency injection (DI) is an incredibly powerful thing. AngularJS (like our favorite PHP framework, Laravel) is based entirely around the concept of dependency injection. DI allows us to write code that depends on interfaces rather than hardcoded dependencies. It is the lifeblood of modularity, helping us stay DRY and allowing us to easily switch out a service to support a 3rd party platform change, API version, or even a logging implementation. Angular's enforcement of strict dependency injection also makes testing your code incredibly straightforward as services and dependencies can be swapped for mocks with ease.
- Write it how you want it! Other frameworks can dictate how your folder structure and models are handled, but with Angular you have the flexibility to organize the way you want. Does your team rely on RequireJS or Browserify? Use it! Just need to bang out a quick one-pager without complicating things? Throw it all in the same file! On the other hand, if you want structure for larger, more complex projects then notable developers like John Papa have put together style guides that can unify a diverse team on a project.
- A robust and active community. Angular is fully open source, which allows it to be constantly driven forward by a thriving community of developers, featuring some of the internet’s front-end masters. From the time we push post on this article, hundreds more Github stars will be piling up. This encourages great UI development practices and pushes the framework, as well as the web, forward with new standards.
- Fantastic educational resources. Learning a new framework is no small task and reading through troves of documentation can often feel overwhelming. Luckily, there's plenty of great places to learn Angular like: egghead.io, learn-angular.org and of course the thousands of answered questions on Stack Overflow.
- Less coding, more functionality please. The view layer is the standard DOM (document object model) and since anyone with basic markup skills can understand the DOM, your designers and product team can follow along. In fact, it was this philosophy from which Angular was born. The framework was built with the idea of giving web designers the ability to “sprinkle magic” over their designs and layouts using what we now know as directives. Fast forward to the present day, and although Angular is a large robust application development framework, it's DOM based templating makes for easy collaboration between designers and developers alike.
- Routing. With AngularJS, binding views and their corresponding controllers to hashbang or pushstate URLs is as simple as can be. Using the ng-view directive you can load views into the DOM as a user navigates your application. Third party routers like ui-router add extra awesome functionality like nested routes, for even more power. Single page web apps have never been so easy.
- Angular 2.0. The Angular team is just getting started. Angular 2.0 has been announced and is close to completion. A complete re-write with performance at the forefront, tight integration with ES6, transpilers and a new partnership with Typescript prove that the Angular team is not finished with pushing web technology forward. We are as excited as the rest of the community for the launch of Angular 2.0.
Some brands we've helped push forward with Angular JS awesomeness already:
Still wondering why you should be embracing Angular? Interested in seeing how our forward-obsessed technologists are loving it? Let's talk.
Looking for an awesome gig? We're hiring.