What’s so special about Google’s AngularJS

Q&A: Misko Hevery, coauthor of the popular Angular JavaScript framework, describes the origins and sweet spots of the web design technology

What’s so special about Google’s AngularJS
Thinkstock

Google’s Misko Hevery is the founding co-author of AngularJS, a popular JavaScript UI framework that has seen considerable growth lately. InfoWorld Editor at Large Paul Krill talked to Hevery about what makes AngularJS tick.

The origins of Angular

InfoWorld: What is so special about AngularJS? Why is there so much interest in it?

Hevery: There’s a lot of Web frameworks out there. What’s unique about Angular is a couple of things. First of all, we have dependency injection, which is very unique. Nobody else has that. But I think that the thing that really hits it home for people is that we have this idea of a directive. Rather than writing everything inside of JavaScript and then having a bunch of templates to generate the UI, you write a lot of it in HTML and HTML drives the assembly of the application. It’s kind of the reverse thing. It’s very unique. Nobody else has this particular approach.

InfoWorld: When did you first publish AngularJS?

Hevery: It started back, I think, in 2009. Back then it was just a thing that I started with a friend of mine. We wanted to see if we could make it easier for web designers—not necessarily web developers, but web designers—to sprinkle a little bit of extra HTML into their code so that they could turn a static form to something they could actually send in an email. The idea would be that you could, for example, have a mom-and-pop shop that sells pizza or something, maybe you could have a simple ordering system just by adding a bunch of these tags and they could send an email to the server.

Angular defined

InfoWorld: What does “Angular” mean? Where did you get the name Angular?

Hevery: That’s a good question. Actually, it was made up by my friend who I started work with. His name is Adam Abrons, and he basically thought that HTML has angle brackets, so angle brackets, Angular.

What is Angular? HTML-enhanced apps

InfoWorld: I saw AngularJS described as a framework for building single web pages, but they’re more dynamic than static. Is that pretty much what it’s about?

Hevery: Yes. That was the beginning. What happened afterward is that I was working at Google and I was working on a project, and I said, “You know what? This crazy idea I’m kind of doing in my free time as an open source thing, I’ll bet you this could actually be useful for building big web applications, not just for a small-time, mom-and-pop kind of thing.” Google started paying attention and slowly it became my full-time job to work on this framework.

InfoWorld: So Angular is HTML-enhanced web apps? How is it enhanced for web apps?

Hevery: We take HTML, which is really good at static documents, and through this concept of directives, we add new markup to HTML that turns static content into dynamic content. Hence we say it’s the HTML-enhancer. Or, I like to say it’s what a web browser would have been had it been designed for web applications.

InfoWorld: Where might AngularJS not be a good fit?

Hevery: That’s a good question. A lot of people have surprised me because I always thought that building games would not be a good fit. Angular was meant for the form-based web. You fill out the form, you see some report of your stock portfolio or something like that. And games are something very, very different. But people surprised me because they keep building games with Angular as well. Really, the sweet spot is form reporting-based development, which is what 80 percent of the web is.

Where to use Angular

InfoWorld: What are some of the more-famous applications that have been built with AngularJS?

Hevery: The nature of Angular is it tends to be mostly used for internal apps because those are mostly form-driven. But externally at Google we have a few apps that we’re proud of. There’s DoubleClick, for advertisers. We also have YouTube Leanback, which is actually also available on PlayStation. You can watch YouTube on your TV. Some parts of the administrative Google App Engine consoles are written on top of Angular as well.

InfoWorld: How does Google leverage AngularJS?

Hevery: We use it internally for many of our applications. One benefit is that because you can be more productive with Angular, people get to build more tools, and through tools you can be a more efficient company.