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
41
votes
2 answers

How exactly is React's Virtual DOM faster?

I understand that there are two arguments for React's Virtual DOM being faster - It updates ONLY those elements that actually need to be updated (using diff). It batches the updates and hence we update the real DOM only a single time. Thus the…
chetan
  • 916
  • 1
  • 8
  • 15
41
votes
3 answers

Exclamation mark after hash (#!) in angularjs app

I have just noticed that I have an exclamation mark after a hash (#!) in all of my routes. I'm not sure how and why I got them because earlier today I didn't have them. If there is any solution to get rid of them, I would appreciate if someone can…
Sahbaz
  • 1,242
  • 4
  • 17
  • 39
41
votes
3 answers

Angular 2 - Merging (extending) objects

How to merge 2 objects with Angular 2? In AngularJS 1 we have the "merge" and "extend" functions: https://docs.angularjs.org/api/ng/function/angular.merge https://docs.angularjs.org/api/ng/function/angular.extend But apparently nothing in Angular…
tadaa9
  • 523
  • 1
  • 5
  • 10
41
votes
6 answers

How to watch component binding change using Angular component

How can I listen to angular component binding change and perform actions? angular.module('myapp') .component('myComponent', { templateUrl: 'some.html', controller: MyController, controllerAs: 'myCtrl', bindings:…
Dor Cohen
  • 16,769
  • 23
  • 93
  • 161
41
votes
7 answers

How to make use of ng-if , ng-else in angularJS

I want to compare id.here if id equals 5 do this, else do that. How can I achieve this?
satyendra kumar
  • 719
  • 2
  • 10
  • 19
41
votes
11 answers

How to send POST in angularjs with multiple params?

I want to send multiple parameters using angularjs HTTP post service. Here is client side code: $http.post("http://localhost:53263/api/Products/", [$scope.product, $scope.product2]). then(function (data, status, headers, config) {…
Michael
  • 13,950
  • 57
  • 145
  • 288
41
votes
11 answers

AngularJS intellisense not working on Visual Studio 2015

According to this post intellisense should also be working on the new VS 2015, but so far I only get intellisense for the angular object and not for the dependencies or my custom modules. Here's what I did: Added the angular.intellisense.js to the…
edua_glz
  • 1,177
  • 2
  • 12
  • 23
41
votes
2 answers

Angular ui-router: how to prevent access to a state

Hello I'm new to angularJS and have been trying to prevent access to certain states based on user critera. This, from ui-router's FAQ describes exactly what I want to do, but I cant get it to work properly. What do I need to but in the data object…
spuleri
  • 515
  • 1
  • 6
  • 9
41
votes
7 answers

ChartJS - Different color per data point

Is there a way to set a different color to a datapoint in a Line Chart if its above a certain value? I found this example for dxChart - https://stackoverflow.com/a/24928967/949195 - and now looking for something similar for ChartJS
Xander
  • 955
  • 1
  • 11
  • 15
41
votes
1 answer

AngularJS : How to access scope from ui-grid cell template?

How does one access $scope from a ui-grid cell template? Here's my controller code: app.controller('MainCtrl', ['$scope', function ($scope) { // i want to reference this from a cell template. $scope.world = function() { return 'world'; }; …
tenfour
  • 36,141
  • 15
  • 83
  • 142
41
votes
7 answers

ui-bootstrap pagination resetting current page on initialization

I am using the pagination directive from the ui-bootstrap (angular-bootstrap) library. I am having an issue when it initializes. My issue occurs when I navigate to a specific page via url. What is happening is that my controller initializes with…
pcgilday
  • 1,032
  • 2
  • 10
  • 15
41
votes
3 answers

How to close Angular UI Modal from anywhere

I am using the Angular UI bootstrap modal dialog and create it within a service: myApp.factory('ModalService', ['$modal', function($modal) { return { trigger: function(template) { $modal.open({ templateUrl:…
DonJuwe
  • 4,477
  • 3
  • 34
  • 59
41
votes
4 answers

Get state of Angular deferred?

With jQuery deferreds I'm used to be able to check the current state like this: var defer = $.Deferred(); defer.state(); //Returns the state of the deferred, eg 'resolved' Is there a way to do the same for Angular deferreds? (or even better…
Evan Hobbs
  • 3,552
  • 5
  • 30
  • 42
41
votes
4 answers

Scroll to top of div in AngularJS?

I am using AngularJS for a small web app and have encountered a problem. I am using ng-repeat to populate a list inside of a div. The div has a fixed height and is set to overflow-y: auto, meaning a scroll bar appears when the list is too big for…
Max
  • 15,157
  • 17
  • 82
  • 127
41
votes
3 answers

CoffeeScript - Referencing DOM nodes in Angular expressions is disallowed

My main question is simple : I get errors when doing DOM manipulation within Controllers or Directives however, the functionality works perfectly. Error: [$parse:isecdom] Referencing DOM nodes in Angular expressions is disallowed! Expression:…
Cosmin
  • 2,082
  • 3
  • 20
  • 24
1 2 3
99
100