3 Reasons to Choose AngularJS for Your Next Project

3 Reasons to Choose AngularJS for Your Next Project

Tutorial Details
  • Difficulty: Intermediate
  • Completion Time: 15 Minutes

AngularJS is a relatively new JavaScript framework by Google, designed to make your front-end development as easy as possible. There are plenty of frameworks and plugins available. As such, it can sometimes prove difficult to sift through all of the noise to find useful tools.

Here are three reasons why you might choose AngularJS for your next project.


1 – It Was Developed by Google

Angular is built and maintained by dedicated Google engineers.

This one may seem obvious, but it’s important to remember that many (not all) frameworks are made by hobbyists in the open source community. While passion and drive have forged frameworks, like Cappucino and Knockout, Angular is built and maintained by dedicated (and highly talented) Google engineers. This means you not only have a large open community to learn from, but you also have skilled, highly-available engineers tasked to help you get your Angular questions answered.

This isn’t Google’s first attempt at a JavaScript framework; they first developed their comprehensive Web Toolkit, which compiles Java down to JavaScript, and was used by the Google Wave team extensively. With the rise of HTML5, CSS3, and JavaScript, as both a front-end and back-end language, Google realized that the web was not meant to be written purely in Java.

AngularJS came about to standardize web application structure and provide a future template for how client-side apps should be developed.

Version 1.0 was released just under 6 months ago (as of December, 2012) and is being used by a host of applications, ranging from hobby to commercial products. Adoption of AngularJS as a viable framework for client-side development is quickly becoming known to the entire web development community.

Because AngularJS is built by Google, you can be sure that you’re dealing with efficient and reliable code that will scale with your project. If you’re looking for a framework with a solid foundation, Angular is your choice!


2 – It’s Comprehensive

If you’re familiar with projects, like QUnit, Mocha or Jasmine, then you’ll have no trouble learning Angular’s unit-testing API.

Angular, similar to Backbone or JavaScriptMVC, is a complete solution for rapid front-end development. No other plugins or frameworks are necessary to build a data-driven web application. Here’s an overview of Angular’s stand-out features:

  • REST Easy. RESTful actions are quickly becoming the standard for communicating from the server to the client. In one line of JavaScript, you can quickly talk to the server and get the data you need to interact with your web pages. AngularJS turns this into a simple JavaScript object, as Models, following the MVVM (Model View View-Model) pattern.
  • MVVM to the Rescue! Models talk to ViewModel objects (through something called the $scope object), which listen for changes to the Models. These can then be delivered and rendered by the Views, which is the HTML that expresses your code. Views can be routed using the $routeProvider object, so you can deep-link and organize your Views and Controllers, turning them into navigable URLs. AngularJS also provides stateless controllers, which initialize and control the $scope object.
  • Data Binding and Dependency Injection. Everything in the MVVM pattern is communicated automatically across the UI whenever anything changes. This eliminates the need for wrappers, getters/setters or class declarations. AngularJS handles all of this, so you can express your data as simply as with JavaScript primitives, like arrays, or as complex as you wish, through custom types. Since everything happens automatically, you can ask for your dependencies as parameters in AngularJS service functions, rather than one giant main() call to execute your code.
  • Extends HTML. Most websites built today are a giant series of <div> tags with little semantic clarity. You need to create extensive and exhaustive CSS classes to express the intention of each object in the DOM. With Angular, you can operate your HTML like XML, giving you endless possibilities for tags and attributes. Angular accomplishes this, via its HTML compiler and the use of directives to trigger behaviors based on the newly-created syntax you write.
  • Makes HTML your Template. If you’re used to Mustache or Hogan.js, then you can quckly grasp the bracket syntax of Angular’s templating engine, because it’s just HTML. Angular traverses the DOM for these templates, which house the directives mentioned above. The templates are then passed to the AngularJS compiler as DOM elements, which can be extended, executed or reused. This is key, because, now, you have raw DOM components, rather than strings, allowing for direct manipulation and extension of the DOM tree.
  • Enterprise-level Testing. As stated above, AngularJS requires no additional frameworks or plugins, including testing. If you’re familiar with projects, like QUnit, Mocha or Jasmine, then you’ll have no trouble learning Angular’s unit-testing API and Scenario Runner, which guides you through executing your tests in as close to the actual state of your production application as possible.

These are the fundamental principles that guide AngularJS to creating an efficient, performance-driven, and maintainable front-end codebase. As long as you have a source for storing data, AngularJS can do all of the heavy lifting on the client, while providing a rich, fast experience for the end user.


3 – Get Started in Minutes

Getting started with AngularJS is incredibly easy. With a few attributes added to your HTML, you can have a simple Angular app up in under 5 minutes!

  1. Add the ng-app directive to the <html> tag so Angular knows to run on the page:
    <html lang="en" ng-app>
    
  2. Add the Angular <script> tag to the end of your <head> tag:
    <head>
    ...meta and stylesheet tags...
     <script src="lib/angular/angular.js"></script>
    
  3. Add regular HTML. AngularJS directives are accessed through HTML attributes, while expressions are evaluated with double-bracket notation:
    <body ng-controller="ActivitiesListCtrl">
      <h1>Today's activities</h1>
      <ul>
       <li ng-repeat="activity in activities">
         {{activity.name}}
       </li>
      </ul>
    </body>
    </html>
    

The ng-controller directive sets up a namespace, where we can place our Angular JavaScript to manipulate the data and evaluate the expressions in our HTML. ng-repeat is an Angular repeater object, which instructs Angular to keep creating list elements as long as we have activities to display, and use this <li> element as a template for how we want all of them to look.

  1. When you want to grab something from Angular, fetch your data with a JavaScript file containing a function whose name corresponds to the controller you’ve outlined in your HTML:
function ActivitiesListCtrl($scope) {
  $scope.activities = [
    { "name": "Wake up" },
    { "name": "Brush teeth" },
    { "name": "Shower" },
    { "name": "Have breakfast" },
    { "name": "Go to work" },
    { "name": "Write a Nettuts article" },
    { "name": "Go to the gym" },
    { "name": "Meet friends" },
    { "name": "Go to bed" }
  ];
 }

As mentioned previously, we’re creating a function with the same name as the ng-controller directive, so our page can find the corresponding Angular function to initialize and execute our code with the data we wish to grab. We pass in the $scope parameter in order to access the template’s activities list that we created in our HTML view. We then provide a basic set of activities with the key, name, corresponding to the activity‘s property name that we listed in our double-bracket notation, and a value, which is a string representing the activities that we want to accomplish today.

  1. While this application is complete, it’s not overly practical. Most web applications house lots of data stored on remote servers. If you’ve got your data stored on a server somewhere, we can easily replace the array with a call from Angular’s AJAX API:
function ActivitiesListCtrl($scope) {
  $http.get('activities/list.json').success(function (data) {
    $scope.activities = data;
  }
}

We’ve simply replaced the native JavaScript array object of hashes with a specialized HTTP GET function, provided by the Angular API. We pass in the name of the file that we watch to fetch from the server (in this case, a JSON file of activities) and we are returned a promise from Angular, much in the same way that the promise pattern works in jQuery.

Learn more about promises in jQuery here on Nettuts+.

This promise can then execute our success function when the data has been returned, and all we have to do is bind the return data to our activities, which as previously stated, was provided by dependency injection, via the $scope parameter.

A static to-do list is nice, but the real power stems from how easily we can manipulate the page without having to set up a bunch of JavaScript functions to listen and respond to user interactions. Imagine that we need to sort our activities list alphabetically. Well, we simply add a drop down selector to allow the user to sort the list:

<h3>Sort:</h3>
<select>
   <option value="name">Alphabetically</option>
 </select>

Add the model directive to the drop down:

<select ng-model="sortModel">

Finally, we modify the <li> tag to recognize sortModel as a way to order our list:

<li ng-repeat="activity in activities | orderBy: sortModel">

All of the heavy lifting is intelligently done by AngularJS.

And that’s it! The secret is the filter we’ve added to the ng-repeat directive in the list item. The orderBy filter takes an input array (our list of activities), copies it, and reorders that copy by the property outlined in the select tag. It’s no coincidence that the value attribute of the option tag is name, the same value that is provided by our JSON file as the property of an activity. This is what allows AngularJS to automagically turn our HTML option value into a powerful keyword for sorting our activities template.

Notice how we aren’t listening for user interaction events. Our code isn’t riddled with callbacks and event handlers for dealing with objects we’ve clicked, selected, touched or enabled. All of the heavy lifting is intelligently done by AngularJS to find the controller function, create the dependency between the template and the controller, and fetch the data to render it on the screen.

AngularJS provides a full and robust tutorial, which creates a very similar web app and expands it even more – all in a matter of minutes!


Conclusion

AngularJS is quickly becoming the dominant JavaScript framework for professional web development.

AngularJS is quickly becoming the dominant JavaScript framework for professional web development.

  • We’ve reviewed how Google came to develop this framework as a way to make the most of HTML.
  • We’ve examined the basic core features and functionality that make Angular such a pleasure to work with.
  • Finally, we’ve developed a dynamic, fully-functional demo in a matter of minutes to demonstrate the true power of how easy it is to go from nothing, to a full application.

If you’re looking for a robust, well-maintained framework for any sized project, I strongly recommend that you take a look at AngularJS. It can be downloaded for free at AngularJS.org, which also contains a wealth of information, including the full API documentation, as well as numerous examples and tutorials that cover every facet of front-end web development. Good luck!

Tags: angularjs
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • geetpurwar

    Hi,
    Just noticed cappucino and knockout looks mislinked, Please check.
    Screenshot: http://grab.by/izds
    Thanks.

    • jeff_way

      Fixed!

      • http://twitter.com/emerazea emerazea

        The link is missing a crucial “c”—should be cappucCino.org.

  • nihal khan

    gud 1

  • http://www.facebook.com/hanushh Hanush H Nair

    im confused on angular.js over ember.js.. which one should i learn/use? what are their difference?

    • Adam Conrad
      Author

      Hi Hanush,

      Ember and Angular are both wonderful front-end frameworks to work with. Both provide templating, binding and RESTful support. The best advice I can give you is to try them both out and see which one fits your workflow better.

    • Jason Berk

      I tried both and angular won out. I think it’s directives are in line with what will become know as shadow DOM and they keep my HTML cleaner…IMO

      I wrote my first angular app in 30 minutes and I’d never written in javascript before.

      I agree with Adam….try both, use what feels comfortable

    • http://twitter.com/lockevn LockeVN Thach Nguyen
    • Den

      Dont use Angularjs, because it dosen’t work on many older browsers including the one in smartphones. You will have to apply shims and stuff and will get really complicated. Also it is very inefficient as it is very CPU hog and apps built on angularjs will kill your clients with weak hardware config. Stick with ember!!

      • luciano stefarelli

        is a joke? :D…emberjs is more inefficient, slow and heavy weight..do you know what are you talking about??…angularjs support new browsers but you can do it works with old browser doing a little trick..or you can use class instead create tags (please refer to http://docs.angularjs.org/guide/ie)…please don’t try help when you don’t have a full understand what are you saying

      • Corrie

        Well you are wrong. Angularjs is indeed very slow because its using dirty checking for every single bootstrap. Do you know if you have large app how expensive it gets? Also Angular is poorly built for slower hardware. I like like ember. Its simple and very efficient.

      • luciano stefarelli

        do you have any reference??..previously I was using emberjs…this has a fast evolution but when I try it was very slow compared to angularjs…and much more heavy weight

        In angularjs you’ve “always” a single bootstrap..and the dirty checking doesn’t say something important about how fast can be it, how mishko said..you’re using a “theoretical arguments”…it’s true than if you’ve 2 thousand objects inside angularjs you will notice a performance decreasing occasionated for the dirty checking…but, actually…angularjs is more optimized and faster than emberjs

        here a real benchmark
        http://jsfiddle.net/oluckyman/vYknU/20/
        http://jsperf.com/angular-vs-knockout-vs-ember/2

        if you’ve other benchmark comparing performance share it..and if you don’t..please don’t base your arguments in a theorical and unreal argument…I’ve found than many bad comments about angjs come from people than misunderstand this…

      • http://www.facebook.com/ezekielvictor Ezekiel Victor
    • rickyduck

      As a user of both I’d suggest trying a todo app in both and see which one suits your need. Personally I prefer the Ember.js philosophy and architecture, however Angular is certainly suited to others better and especially under certain circumstances. It’s definitely not Apples & Oranges, but it certainly is Golden Delicious and Granny Smith

    • vobro

      Seems that Ember is more mature but Angular has some speedier approaches to how pages / values should be rendered/bound where Angular ends up a better architecture but not something Ember couldn’t adopt doing itself soon and have a tremendous amount of project momentum comparatively speaking.

  • Rashid Omar

    I think I will go with Angular!

  • http://twitter.com/_ketann KD

    demo link doesn’t work

  • http://www.facebook.com/mittul.chauhan Mittul Chauhan

    glad to see this is from google .. reliable ..

  • http://www.facebook.com/abdulrahman.mohamed.37 Abdulrahman Mohamed

    it’s better than backbone.js ? if answer yes or no , why ?

    • Adam Conrad
      Author

      “Better” isn’t the right word – I’d go with “different.” Backbone and Angular are both comprehensive front-end development frameworks, offering templating, RESTful connections and some flavor of MVC/MVVM design patterns. You will write far less code with Angular than Backbone, at least for the most common web app client-side tasks. While Angular is backed by Google, Backbone has been around much longer (not to mention I know Backbone’s developer personally, he’s a great developer) so the open source support might be stronger on Backbone. The advice I give everyone is if you’re stuck between two, make a trivial app with both and see which one you like more.

  • http://www.facebook.com/dgrimes87 Dan Grimes

    Thank you! Ill have to check this out when i get home! I find alot of frameworks hard to understand but this one looks very easy to tinker around with <3

  • http://twitter.com/kborchers Kris Borchers

    Curious if this is your observation or if Google actually said, “Google realized that the web was not meant to be written purely in Java.” and also wondering where the quote after that line came.from.

    • Adam Conrad
      Author

      This is more an anecdotal observation – Google is, at its core, a Java shop. They originally wrote the GWT which was meant to turn Java into Javascript so developers only needed to learn Java. Now that they develop and support Angular, which is native Javascript, it’s pretty clear they no longer are looking to unify the web solely on Javascript.

  • Said Kaldybaev

    the combination AngularJS with Rails seems promising

    • Adam Conrad
      Author

      We actually use AngularJS for our mobile apps with a RESTful Rails back-end over at my company StarStreet, it’s working quite well!

    • BrianFrichette

      Indeed, I have had the same experience. It’s really simple to create services that are a reflection of your REST api, and since you can use POJOs you can send the same data models back.

  • Al
    • http://twitter.com/rtorcato Richard Torcato

      knockoutjs is fantastic.

  • Marios Antonoudiou

    Thanks for this article! I had no idea about angularJS and this was exactly what I needed! I will definetely use it with my next project!

  • http://robert-agthe.de Robert Agthe

    Im not really sure it´s the right way to put all your logic into the DOM with fake elements or attributes. And to clarify one thing: Because it´s from Google means not its good.

    • http://twitter.com/ivanca Ivan Castellanos

      He didn’t say that because is Google is “good”; he never even used the word “good” except for “good luck”.

      And yeah; I am pretty sure that this project would be just as solid and promising if some guy called Robert Agthe were the author of the project.

    • kamranayub

      I was wary of KnockoutJS for that reason (“logic” in the DOM) but I’ve come to prefer it. As a developer working on a team with varying levels of JS experience, I’ve found attribute-based binding to be clearer, and way more “in your face” than other approaches. It also cleanly separates (if you’re doing it right) DOM manipulation from your view model/logic. With the power of custom bindings and given how extensible KO is, I’ve come to use it on every JS-based project I work on. Angular seems pretty promising as a more complete framework, so I might explore it more too.

    • Jonas

      AngularJS supports the use of “data-” attributes. E.g., you’d write “data-ng-controller” instead of “ng-controller”. That means it’ll be valid HTML5.

  • rcakirerk

    In my opinion: Angular.js is a bit of an experimental / research project that describes the paradigm with scopes, directives… etc. instead of models, views, controllers that cause a more steep learning curve.

    “Developed by Google” is a very weak argument; it actually doesn’t prove anything at all and it shouldn’t be enough for anyone while choosing a product. This might be an advantage or a disadvantage depending on how well Google treats the non-googler developers.

    I’ve read about Angular.js getting slower while the project gets bigger. One of the Angular.js developers claim that the performance issues aren’t visible to the human eye if there are less than 2000 binded objects; but it still disturbing to know that you have such a limitation.

    Before choosing a javascript framework have a look at Addy Osmani’s TodoMVC -> http://addyosmani.github.com/todomvc
    You can clone the repo and compare the todo application source codes that are written in nearly all well known javascript frameworks.

    • andres

      and which framework do u recommend??..emberjs is slower than angularjs and backbonejs isn’t so complete as angular…also it’s less expresive…about 2000 binds…for me it’s a reasonable number..do you need more 2000 binds in a single page app??…maybe if you need more then your interface isn’t so good

      • http://ren.io/ Renan Cakirerk

        I think no one can recommend a product without knowing the needs of a person. To me, it looks like there is no ultimate framework yet that can satisfy every need, like there is no ultimate medicine that cures all diseases. Plus, I am “super new” to javascript frameworks so I’m not in a position to recommend anything about it.

        If you are not sure what your needs are, you can actually discover them on the road while researching and playing with frameworks like I did.

        I’d like to share my experience and what I’ve read so far -> Caution: “read skeptically!”.

        For the current project I’m working on, I needed such a framework:
        -> That is easy to learn and understand (unlike Angular.js)
        -> That didn’t have any weird terminology (unlike Angular.js)
        -> That is not very young (unlike Ember.js)
        -> That has good separation between models, views and controllers (unlike Backbone.js)
        -> That has mechanisms to prevent zombie views and memory leaks and doesn’t expect the developer to write everything from scratch (unlike Backbone.js)
        -> That didn’t need tons of plugins to do simple tasks (unlike Backbone.js, Ember.js)
        -> That is flexible enough / plays well with other template systems (unlike Ember.js with Handlebars)
        -> That has methods out of the box for connecting to REST endpoints (unlike Ember.js)
        -> That didn’t use excessive memory (unlike Knockout.js)
        -> That has a fair amount of documentation (relative to your skills)
        -> That wasn’t written in CoffeeScript. (to prevent wasting time caused by debugging difficulties that the team will come across while learning CoffeeScript) (unlike Spine.js)

        So after a long research and a couple of experiments, I’ve decided to go with CanJS which seems pretty much in the middle of everything listed above.

        CanJS:
        -> Has a solid background since it actually comes from the JavaScriptMVC framework (http://en.wikipedia.org/wiki/JavaScriptMVC)
        -> Is tiny (11kB)
        -> Is fast as Backbone.js (Performance comparison -> http://jsfiddle.net/byMrf/)
        -> Is pretty easy to read and understand
        -> Prevents zombie views and memory leaks
        -> Works with ejs, mustache, handlebars template systems with live binding
        -> Has REST compatible models
        -> Has good separation between models, views and controllers
        -> Has “fixtures” that can simulate REST endpoints. This is really handy while developing the frontend before completing the backend
        -> Has computables, state backups, observables… etc
        -> Plays nice with AMD (asynchronous module definition)
        -> Future: It is going to have two-way bindings and a more clever view rendering system in the next release (which I’ve learned from a developer while talking on IRC)
        -> Extras: A very friendly and helpful community
        -> Cons: Relatively weak documentation and examples

        Now I’m building the app and so far it looks good. I haven’t regretted my decision yet. Time will show.

        Anyway, try to discover your needs, talk with developers on IRC and play with frameworks until you decide what’s best for your case.

        If you are interested in CanJS, you can learn more on -> http://canjs.us/#why_canjs

    • BrianFrichette

      This post is full of ignorant suppositions.

      To your first comment regarding the supposed “experimental” status of AngularJS, you are wrong on many fronts.

      First, Angular has been in development for nearly 3 years. It started as an experiment, and was quite crufty for a long time. However, Angular was built in conjunction with an overhaul to Google’s Doubleclick ad site, where it is used today to provide the administrative front end for doubleclick accounts. From this process, many of the structural and design patterns, performance issues, syntax selection, flexibility problems, etc., were solved through battle-testing on that project. For a more detailed history: http://www.youtube.com/watch?v=oJoAnVRIVQo

      Second, you claim that Angular “describes the paradigm with scopes, directives, … etc.” instead of MVC. This is utterly false. Angular in my experience is actually much more traditionally MVC-patterned than most of the other high-market-share contenders. Particularly, knockout and backbone are not even attempting to be MVC.

      Angular has very definite separation of models, views, and controllers. What it also has, are separate concepts that help tie these together for ultimate flexibility and power. For example, services often contain logic that could be in a controller, but you abstract them to a service because you want to share state been multiple controllers, or you have functionality that is used throughout many controllers.

      Scopes, have nothing to do with the “paradigm”. They a concept borrowed from many types of programming that simply defines a ruleset for encapsulation and inheritance based on the instantiation of certain “scoped” items. They are both useful and powerful, and do nothing change the MVC structure of the applications you build in Angular.

      Directives are another concept that are simply an extension of the base application pattern: They allow an explicitly defined way of interacting with a strictly MVC application from OUTSIDE the application itself. They are the interface for creating custom behavior and incorporating that into an app that must sync its state between models and views. This interface gives you an awesome API for creating reusable components that can then tell your app when to update.

      All of these concepts are extensions of a core MV* philosophy that underlies Angular. What Angular does is goes beyond that basic MV* separation of concerns and allows you to structure your applications in a way that solves problems that MV* alone does not have a great solution for. Thus you now have an MVC app, that also has access to services for abstracting and sharing common logic or behavior, you have directives for integrating jQuery plugins or writing custom behavior and DOM manipulation, you have route management, you have history and state managment, you have form validation, etc.

      With regard to your statement on 2000 data-bindings, and I’ll show you a way to write your application in a much friendlier way.

      Now that being said, I do recommend TodoMVC.

      • pixelBender67

        Nice!

      • http://ren.io/ Renan Cakirerk

        Thanks for the clarification. It was enlightening, but I still think that Angular.js requires more time to learn; at least it was the case for me and I think it will be the case for most newbies.

        My previous comment might sound like I’m claiming that Angular.js is bad, but I actually never said anything like that.

        I can tell you that there aren’t many good, trustable, technical articles about javascript frameworks and their comparisons. So instead of trying to hunt down stupid comments, *please* write a quality article so newbies can learn something from your experience and start writing good comments.

        It would be cool if you can comment on the things I’ve found while reading a lot of comments (stack overflow) and articles about comparisons and while experimenting with the javascript frameworks, so if you have time checkout my reply to “andres” below.

      • BrianFrichette

        I actually contacted Jeffrey about creating an AngularJS course. I think I’ll reach out again (we lost touch at some point, and I just started a new job). Whether we can work out an arrangement or not, I’m still going to create some tutorials when I get a moment. I really wanted them to be presented here so that they can reach the largest audience.

        Regarding your comment about AngularJS being harder to learn, I would have to agree there–at least initially–for people coming from a traditional jQuery/DOM interaction background. However, I think you’ll find that, if you get past the initial upward resistance, Angular is actually considerably easier. AngularJS is so well structured that you have to absorb a certain mindset before the “Angular way” clicks. Once, it does, most of the heavy-lifting of app creation via AngularJS is generally within your grasp.

        I chose AngularJS based on building sample apps with Ember, Backbone, and then Angular, and based on quite a bit of research. During this research, it took a bit of a leap of faith for me to choose AngularJS, b/c the other two tools (especially Backbone) are much closer to the traditional sort of interactions most of us are used to in front-end JS.

        For example I remember going to AngularJS right after Ember, and thinking “How the heck do I create ‘computed properties’”? This was something I found to be a cool feature of Ember, and I couldn’t immediately find an analog in AngularJS. However, creating computed properties in Angular is not only simple, the syntax and structure is much more explicit and semantically relevant.

        A common way to do this is to tie the property as a fn call to your view, and set it’s model for the scope you’re in. That means that anytime an angular $.digest occurs (basically, whenever something UI relevant changes), the property is automatically calculated and synched with the model.

        Or you could just tie the fn call to compute your property to a particular view event that you specify, that way you only update it when you want to.

        Or you could set a customer watcher that checks for a specific condition and then computes your property.

        When you use any of these, you’ll see how they are both simple to implement and are kept semantically relevant by the fact that you have the control to tie the exact type to the exact circumstance you require. Hard to describe, so hopefully I have time to punch out an intro tut this weekend.

        Finally, I just want to say: Point taken about the stupid comments thing. I had to respond b/c your post had 7 likes, and well, I’m partial to AngularJS :P. But you’re right, the AngularJS community needs to work to disseminate quality information in an approachable way. So, I’m going to do my best to do so.

        -Brian

      • Ian

        Would be awesome to see a course on tutsplus like the backbonejs courses by Jeffrey and Andrew. And/or some freebie tuts here on nettuts to help getting started.

        Angular sounds like a great second framework to learn to have another alternative.

      • Adam

        Yes! +1 for a premium Angular course even. there is a lot out there, but nothing with the standards and quality of a net.tuts.premium course.

  • http://twitter.com/rtorcato Richard Torcato

    I’ll stick with knockoutjs which is so much better. I prefer not use anything from Google Spyware Inc.

    • http://www.facebook.com/profile.php?id=603316690 Caleb Olin

      I don’t think Knockout vs Angular is a valid comparison. Both provide 2-way binding, but after that the similarities end.

  • http://www.facebook.com/sannysinghs Sanny Singhs

    Hi … it definately sure that i’ve never been used js framework before but jquery …. what’s the difference … what are the adv of using Js framwork like this …

    • Adam Conrad
      Author

      Hey Sanny,

      Think of jQuery as a library – it extends and simplifies Javascript so you can write Javascript easier. Angular is a framework, so it takes common tasks, like populating the DOM and handling requests from a server, and wraps them into tidy methods and APIs so you don’t have to worry about creating a lot of boilerplate Javascript code. The advantage is that you can write far less code to accomplish common tasks (like AJAX requests) and you can spend much more time working on the application logic, the stuff that makes your web app unique.

  • Jaspal Singh aka jsxtech

    Great!, sure will try.
    Thanks for sharing.

  • http://www.jsxtech.com Jaspal Singh aka jsxtech

    Great! sure will try.
    Thanks for sharing.

  • SunChero

    sorry buy your first argument is very weak i will stick to Canjs Angular for me is a nice experiment no more

  • http://twitter.com/mrsteel Aleksandar Gvozden

    Here is DEMO – Nothing found ! Link is not working!

  • rmwebs

    There still seems to be no real information on WHY you should use a javascript framework. Obviously things like jQuery have the benefit of lots of plugins and fancy bits and bobs, but what is the benefit of using one ‘for the sake of it’. Nobody anywhere seems to have created a comprehensive article detailing the pros and cons of why you should/shouldn’t use a framework, and what the true definition of a javascript framework is.

    • 2dfruit

      Why would you use a javascript framework like Angular?

      well if you’re familiar with js and have developed apps with it before using plain old vanilla js, then this site will explain it all

      http://angularjs.org/

  • Konga Raju

    See SO Thread : http://stackoverflow.com/questions/6548826/angular-js-vs-backbone-js

    That means, building app is super fast, but it doesn’t have to fit everyone nor every app.
    Note, I’m member of AngularJS team, so this might not be objective :-D

    so AngularJS is not meant for all the web applications.

  • http://www.facebook.com/oluwaseye Oluwaseye Hiroshi Ogunkoya

    Nice Tutorial

  • Stef

    The name and the url of Cappuccino are mispelled. It is http://cappuccino.org/ (with double ‘c’)

  • Alchemication

    Having completed already 5 Angular apps (maybe not too not large ones) – I have to say that I am very pleased with the results. Everything seems to be working, development speed is very rapid and it’s only faster and more elegant with the next project. Yes (just like with any other technology) there are some gotchas, but generally speaking I was able to solve problems quickly using StackOverflow or just a bit of thinking (;D)
    Just to add that I have used Backbone before (and like everyone in jQuery) – and I personally find Angular to be the most dev-friendly JS tool that I have seen so far.
    PS: Fans of jQuery will enjoy the fact that Angular comes with built-in basic jQuery version, so DOM manipulation is still the same peace of cake (if you still need it though ;)

  • Alex Wright

    I’ve played around with Can.js and Angular.js a little bit. Bear with me, but I’m struggling to see the benefit of creating a web-app that relies so heavily on js instead of using a server-side language. I mean, I guess if I think about it, you can perform many of the actions for a web-app on the client-side to minimize trips to the server. Then, when you need to do something sensitive, or database driven, you can connect using REST or other methods. Is that the main benefit? Could someone explain that to me?

    • pixelBender67

      It’s faster, its modern, deal with it

      • Alex Wright

        Lol, I plan to. Before I delve into it, I was just wondering if anyone could offer any explicit benefits that I may have overlooked. I guess I’ll just have to look for myself :)

    • Rogier Borst

      It’s for avoiding page refreshes for every little thing your visitor does. The frameworks use AJAX to communicate with the server, but is continuously aware of your data set. This way, when you, say, update a record, your application can instantly show the changes.

  • http://pomodoro.nl Ben van de Sande

    While I like Angular.js very much this article makes no sense at all and I can’t understand why people are spamming this article on twitter. None of the 3 points should be a reason to use it. The main reasons can be found on the angular page site itself: http://angularjs.org/ or if you want to do a comparison look at http://coding.smashingmagazine.com/2012/07/27/journey-through-the-javascript-mvc-jungle/.

  • pixelBender67

    I’m still a bigger fan of Backbone than the others, too much ‘magic’ going on with Knockout and Ember, I am interested in Angular though ,plus Google is behind it ,and I am really liking Derby.js just my 2 cents for what it’s worth

  • Trevor

    In my opinion, the ability to create and use custom HTML tags is not a feature. With the advent of HTML5, there’s more than enough richness to create a user interface, without a custom DOCTYPE or new structure to learn.

    For XML, this makes sense; it’s a data transfer format. HTML was designed to structure web pages. This fact swung me from Angular to Backbone JS.

    • Jonas

      No custom HTML tags are needed, as far as I know. The examples above do use custom attributes, but you can add “data-” in front of them to make them valid HTML5. AngularJS supports that. So instead of “ng-controller” you’d write “data-ng-controller”.

  • Mark

    I’ve experimented with Angular.

    It´s great for small stuff, you can really start in no time and see great results.

    The problem is when you want more, when you start to build something bigger and more complex. That’s the time when the documentation, that looks great on your first time, start to look useless. The docs are incomplete, shallow and always leaves you with “ok, I think i got this… but this part here, HOW THE HELL DOES THIS WORK”, and there you go googling for an answer or waiting for some enlightened soul to answer your question on the angular Ggroups.

    If you have time to spend on searching and discovering, that’s a nice place to be. You can tinker and find stuff not documented, learn from it, improve it.

    But if you need to build something big and start ASAP, try something else.

  • http://arundadhwal.com/ Arun

    url to cappuccino framework is wrong

  • Omar McKenzie

    Is this compatible with dartlang?

  • MPinteractiv

    I’ve built 2 littles apps with angular ,

    + a flickr search app : http://paraiso-flickr-search.herokuapp.com/

    + a fake sushi shop card app : http://joly-sushi.herokuapp.com/#/sushi

    AngularJS is great , data-binding works quite well , there are lot of neat things , however :

    - you must be prepared to extend the framework when you need to custom stuff , or use a jquery plugin . AngularJS directives are the equivalent of views in Backbone , that’s where all the dom manipulation stuff is supposed to be done.

    - the doc is just horrible , not up to date and confusing, that should be the main focus of the AngularJS team .

    - AngularJS apps feel slow, no doubt about it , it can be improved but my backbone apps felt faster.

    - there is quite a lof of things to learn to get started with AngularJS , html serves as a IOC container descriptor ,like mxml for flex for instance , so you dont need to instanciate any object you create. Just tell AngularJS how to with html.

    - there is cleary some cases ( especially with ng-repeat ) that are not handled well with Angular.( ex : using dt/dl/dd , … , or “padding” a collection ).

    - if you like animating stuffs ( transitions between states , which are easy to do with backbone ) , it will be a lot of pain to do with AngularJS , if you dont care about transitions and effects , AngularJS is the fastest way to build apps.

    So in my opinion , AngularJS makes you write less code but , as soon a you need to write custom stuffs like directives, you’ll have to write a lot of code anyway , and you need to understand IOC containers or you wont go far with angular.

  • http://twitter.com/imdeany I’m Deany HW

    Great article, will be giving Angular JS further attention :)

  • Jason Berk
  • Mike

    too bad the tutorials and documentation suck

    • moss

      yea but if you stick to it u’ll be happy u did…actually i got a headache while learning AngularJS

  • chuba

    why my comment was delete??…I dont offend and show why I consider angularjs better option over other frameworks..

  • Abraham

    can we use jquery and angularjs simultaneously?? because i greatly depend on jquery for animating dynamic contents.

    • moss

      yep you can but you’d better “animate” from within angularJs directives

    • Kevin

      Angular comes with a light version of jquery, but yes you can use jquery and jquery-ui with angular without a problem.

  • http://twitter.com/unsalkorkmaz Unsal Korkmaz

    Sorry i dont trust Google anymore. They can close anything they want.. like google reader or translation api