Questions tagged [angularjs]

Use for questions about AngularJS (1.x), the open-source JavaScript framework. Do NOT use this tag for Angular 2 or later versions; instead, use the [angular] tag.

AngularJS is an open-source JavaScript framework for building CRUD-centric Ajax-style web applications. Its goal is to shim the browser to augment the HTML vocabulary with directives useful for building dynamic web applications.

AngularJS ships with directives which add two-way data binding, DOM control and unrolling, code-behind DOM, form validation, and deep linking.

Initially released in 2009, AngularJS was developed and maintained by Google, and is used internally by Google in 1600+ applications.

Note: AngularJS refers to all 1.x versions of the framework, while Version 2 and higher are referred to now as "Angular" (see It's just Angular). The [tag: angular] tag should only be used for questions pertaining to versions 2 and higher.

AngularJS's Philosophy

  • Encourages developers to create their own directives, turning the HTML into a DSL suited to building their kind of application. The result significantly reduces the amount and complexity of JavaScript needed to build web applications.
  • UI is best described in the declarative form (HTML), and that behavior is best described in an imperative form (JavaScript) and that the two should never meet.
  • Encourages developers to design their client architecture using advanced software principles like dependency injection (DI), separation of concerns (SoC), testability, and a file structure.

Notable features

  • Teach your browser new tricks by adding behavior to HTML tags/attributes
  • Controllers provide code-behind DOM with clear separation from the view
  • Two-way data binding without the need to extend or wrap the model objects
  • Dependency injection assembles the application without 'main' method
  • Promises/futures remove many callbacks from code when communicating with the server
  • Directives
  • Views and routes
  • Filters
  • Form validation
  • Strong focus on testability
  • Extend HTML with your own behavior
  • Angular uses spinal-case for its custom attributes and camelCase for the corresponding directives which implement them

Versions

Notable AngularJS versions, code names, and release dates include:

Version Code Name Release Date
AngularJS 1.0.0 temporal-domination June 6, 2012
AngularJS 1.1.0 increase-gravatas August 31, 2012
AngularJS 1.2.0 timely-delivery November 8, 2013
AngularJS 1.3.0 superluminal-nudge October 13, 2014
AngularJS 1.4.0 jaracimrman-existence May 26, 2015
AngularJS 1.5.0 ennoblement-facilitation February 5, 2016
AngularJS 1.6.0 rainbow-tsunami December 8, 2016
AngularJS 1.7.0 nonexistent-physiology May 11, 2018
AngularJS 1.8.0 nested-vaccination June 01, 2020

Latest Stable Version:

Version Code Name Release Date
AngularJS 1.8.2 meteoric-mining October 21, 2020

Actively developed Version:

AngularJS v1.8.x  

For code names, release dates and notes visit the GitHub changelog. To see the latest announcements and AngularJS discussions, visit the official Angular Blog or AngularJS on Gitter

Bits

Community

Asking a question

  • Mention which version of AngularJS you're using
  • Reduce your issue to a small example
  • Explain the behavior you experienced and its difference from your expectations
  • Post a reduced working code on plnkr.co or jsfiddle.net
  • Don't know how? Clone one of these existing jsFiddles

Getting Started

Style Guides

AngularJS UI Libraries

Debugging

Testing

Recent

2014

2013

2012

2011

2010

Video Tutorials

Who is using

Developed by Google

262787 questions
727
votes
10 answers

if else statement in AngularJS templates

I want to do a condition in an AngularJS template. I fetch a video list from the Youtube API. Some of the videos are in 16:9 ratio and some are in 4:3 ratio. I want to make a condition like this: if video.yt$aspectRatio equals widescreen then …
vzhen
  • 11,137
  • 13
  • 56
  • 87
710
votes
8 answers

How to iterate over the keys and values with ng-repeat in AngularJS?

In my controller, I have data like: $scope.object = data Now this data is the dictionary with keys and values from json. I can access the attribute with object.name in the template. Is there any way that I can iterate over the keys as well and…
user192362127
  • 11,385
  • 8
  • 24
  • 21
702
votes
15 answers

How do search engines deal with AngularJS applications?

I see two issues with AngularJS application regarding search engines and SEO: 1) What happens with custom tags? Do search engines ignore the whole content within those tags? i.e. suppose I have

Hey, this title is…

luisfarzati
  • 8,649
  • 6
  • 29
  • 27
694
votes
29 answers

How do I bind to list of checkbox values with AngularJS?

I have a few checkboxes: That I would like to bind to a list in my controller…
nickponline
  • 25,354
  • 32
  • 99
  • 167
672
votes
26 answers

Why does AngularJS include an empty option in select?

I've been working with AngularJS for the last few weeks, and the one thing which is really bothering me is that even after trying all permutations or the configuration defined in the specification at…
Sudhanshu
  • 6,893
  • 3
  • 19
  • 10
659
votes
15 answers

How to use a filter in a controller?

I have written a filter function which will return data based on the argument you are passing. I want the same functionality in my controller. Is it possible to reuse the filter function in a controller? This is what I've tried so far: function…
sumanth
  • 6,593
  • 3
  • 13
  • 7
630
votes
20 answers

Confused about Service vs Factory

As I understand it, when inside a factory I return an object that gets injected into a controller. When inside a service I am dealing with the object using this and not returning anything. I was under the assumption that a service was always a…
JvdBerg
  • 21,777
  • 8
  • 38
  • 55
620
votes
12 answers

Adding multiple class using ng-class

ALERT: This thread is for the old AngularJS! Can we have multiple expression to add multiple ng-class ? for eg.
If yes can anyone put up the example to do so. .
Aditya Sethi
  • 10,486
  • 11
  • 26
  • 31
594
votes
14 answers

Can one AngularJS controller call another?

Is it possible to have one controller use another? For example: This HTML document simply prints a message delivered by the MessageCtrl controller in the messageCtrl.js file.
BanksySan
  • 27,362
  • 33
  • 117
  • 216
589
votes
7 answers

AngularJS passing data to $http.get request

I have a function which does a http POST request. The code is specified below. This works fine. $http({ url: user.update_path, method: "POST", data: {user_id: user.id, draft: true} }); I have another function for http GET and I want to…
Chubby Boy
  • 30,942
  • 19
  • 47
  • 47
568
votes
27 answers

How do I set the value property in AngularJS' ng-options?

Here is what seems to be bothering a lot of people (including me). When using the ng-options directive in AngularJS to fill in the options for a