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

Latest Stable Version:

Version Code Name Release Date
AngularJS 1.7.4 interstellar-exploration September 07, 2018

Actively developed Version:

AngularJS v1.7.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

262180 questions
40
votes
3 answers

AngularJS Web Api AntiForgeryToken CSRF

I have an AngularJS Single Page Application (SPA) hosted by an ASP.NET MVC application. The back-end is ASP.NET Web Api. I would like to protect it against CSRF attacks by generating an AntiForgeryToken in the ASP.NET MVC part, pass it to AngularJS,…
Mihai Dinculescu
  • 18,663
  • 8
  • 48
  • 66
40
votes
4 answers

Custom child directive accessing scope of parent

I am having two custom directives in my angularJS app. One act as a parent and other act as child. I am trying to access parent's scope inside child directive. But I am not getting the desired output.
{{myName}} …
Sriram
  • 735
  • 2
  • 17
  • 41
40
votes
6 answers

Ionic: How to center a div?

THE SITUATION: I am making an app using Ionic framework. In one page i need to display an image. This image has to be horizontally centered. ATTEMPT 1: Following the documentation i have divided one row into three equal columns and put the image in…
FrancescoMussi
  • 17,011
  • 36
  • 113
  • 166
40
votes
6 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,012
  • 2
  • 9
  • 15
40
votes
4 answers

How to disable caching of single page application HTML file served through IIS?

I have a single page application (angular-js) which is served through IIS. How do I prevent caching of HTML files? The solution needs to be achieved by changing content within either index.html or the web.config, as access to IIS through a…
Andrew
  • 5,037
  • 3
  • 32
  • 39
40
votes
13 answers

angularjs form reset error

i'm trying to do a form with validations using angularjs and so far i did a good job. But when i commit my reset button all the fields reset except for the error messages i get from my validation part. How can i get rid of all the fields and error…
CraZyDroiD
  • 5,264
  • 21
  • 64
  • 138
40
votes
5 answers

AngularJS - refresh ng-repeat

I'm using ng-repeat to display a collection of values. My filter options changes according to an ajax call to server. How can I refresh the ng-repeat after the filter parameters have been received? js fiddle Template
user1477955
  • 1,552
  • 6
  • 21
  • 34
40
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,107
  • 3
  • 28
  • 53
40
votes
17 answers

Ionic - How to remove sidemenu on login page only?

I need to remove sidemenu only on my login page. Otherwise remain. How it can be done? I'm using command ionic ionic start myApp sidemenu to create the project. app.js .config(function($stateProvider, $urlRouterProvider) { $stateProvider …
Mohammad Nurdin
  • 20,761
  • 38
  • 117
  • 280
40
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,231
  • 5
  • 26
  • 37
40
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
  • 13,084
  • 12
  • 69
  • 109
40
votes
9 answers

How to prevent an angular-bootstrap dropdown from closing (Unbind Event which was bound by a directive)

I am using the Angular-Bootstrap Dropdown. I want to prevent it from closing on click until the user closes it intentionally. Default state is: The Dropdown closes when clicking somewhere in the Document. I identified the relevant lines of code:…
ulilicht
  • 717
  • 1
  • 7
  • 18
40
votes
5 answers

Angular Protractor - Leave browser open after E2E tests

Is it possible to leave the test browser windows open after Angular Protractor tests run? I have a tough test failing in FireFox and it'd be useful to access the state of the web page to see what's going on.
BradGreens
  • 1,328
  • 4
  • 15
  • 31
40
votes
13 answers

How do I disable the save password bubble in chrome using Javascript?

I need to be able to prevent the Save Password bubble from even showing up after a user logs in. Autocomplete=off is not the answer. I have not come across a post that offers a secure solution for this issue. Is there really no way to disable the…
Cognitronic
  • 1,376
  • 2
  • 14
  • 29
40
votes
3 answers

Parameters for states without URLs in ui-router for AngularJS

I am using ui-router to represent states in my AngularJS app. In it I'd like to change the state without changing the URL (basically a "detail view" is updated but this should not affect the URL). I use to…
akirk
  • 6,388
  • 2
  • 31
  • 54
1 2 3
99
100