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.

4529
votes
15answers
770k views

“Thinking in AngularJS” if I have a jQuery background? [closed]

Suppose I'm familiar with developing client-side applications in jQuery, but now I'd like to start using AngularJS. Can you describe the paradigm shift that is necessary? Here are a few questions that ...
930
votes
3answers
139k views

What are the nuances of scope prototypal / prototypical inheritance in AngularJS?

The API Reference Scope page says:A scope can inherit from a parent scope.The Developer Guide Scope page says:A scope (prototypically) inherits properties from its parent scope.So, does a ...
3077
votes
30answers
722k views

AngularJS: Service vs provider vs factory

What are the differences between a Service, Provider and Factory in AngularJS?
314
votes
9answers
231k views

Share data between AngularJS controllers

I'm trying to share data across controllers. Use-case is a multi-step form, data entered in one input is later used in multiple display locations outside the original controller. Code below and in ...
933
votes
7answers
253k views

'this' vs $scope in AngularJS controllers

In the "Create Components" section of AngularJS's homepage, there is this example:controller: function($scope, $element) {var panes=$scope.panes=[];$scope.select=function(pane) {...
1729
votes
13answers
318k views

How does data binding work in AngularJS?

How does data binding work in the AngularJS framework?I haven't found technical details on their site. It's more or less clear how it works when data is propagated from view to model. But how does ...
720
votes
18answers
578k views

Insert HTML into view

Is it possible to create an HTML fragment in an AngularJS controller and have this HTML shown in the view?This comes from a requirement to turn an inconsistent JSON blob into a nested list of id : ...
961
votes
15answers
481k views

What is the difference between '@' and '=' in directive scope in AngularJS?

I've read the AngularJS documentation on the topic carefully, and then fiddled around with a directive. Here's the fiddle.And here are some relevant snippets:From the HTML:<pane bi-title="...
39
votes
2answers
22k views

Why are angular $http success/error methods deprecated? Removed from v1.6?

The angular documentation has a Deprecation Notice for the $http success and error methods. Is there a specific reason this abstraction was removed from the library?
64
votes
3answers
28k views

Why don't the AngularJS docs use a dot in the model directive?

In the video AngularJS MTV Meetup: Best Practices (2012/12/11), Miško explains "..if you use ng-model there has to be a dot somewhere. If you don't have a dot, you're doing it wrong.."However, the ...
815
votes
13answers
530k views

Working with $scope.$emit and $scope.$on

How can I send my $scope object from one controller to another using .$emit and .$on methods?function firstCtrl($scope) {$scope.$emit('someEvent', [1,2,3]);}function secondCtrl($scope) {...
452
votes
19answers
191k views

What's the correct way to communicate between controllers in AngularJS?

What's the correct way to communicate between controllers?I'm currently using a horrible fudge involving window:function StockSubgroupCtrl($scope, $http) {$scope.subgroups=[];$scope....
260
votes
27answers
618k views

File Upload using AngularJS

Here is my HTML form:<form name="myForm" ng-submit=""><input ng-model='file' type="file"/><input type="submit" value='Submit'/></form>I want to upload an image ...
957
votes
7answers
803k views

How do I use $scope.$watch and $scope.$apply in AngularJS?

I don't understand how to use $scope.$watch and $scope.$apply. The official documentation isn't helpful.What I don't understand specifically:Are they connected to the DOM?How can I update DOM ...
225
votes
18answers
311k views

Passing data between controllers in Angular JS?

I have a basic controller that displays my products,App.controller('ProductCtrl',function($scope,$productFactory){$productFactory.get().success(function(data){$scope.products=...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,