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
20,034
questions
4502
votes
15
answers
855k
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 ...
1051
votes
3
answers
157k
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 ...
283
votes
14
answers
740k
views
How can I access the value of a promise?
I'm looking at this example from Angular's documentation for $q, but I think this probably applies to promises in general. The example below is copied verbatim from their documentation with their ...
3422
votes
30
answers
785k
views
AngularJS: Service vs provider vs factory
What are the differences between a Service, Provider and Factory in AngularJS?
371
votes
11
answers
281k
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 ...
65
votes
2
answers
46k
views
Why are AngularJS $http success/error methods deprecated? Removed from v1.6?
The AngularJS documentation has a Deprecation Notice for the $http success and error methods. Is there a specific reason this abstraction was removed from the library?
1055
votes
7
answers
311k
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) {
...
2048
votes
14
answers
359k
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 ...
836
votes
17
answers
702k
views
Insert HTML into view from AngularJS controller
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: ...
18
votes
3
answers
4k
views
Is this a "Deferred Antipattern"?
I'm finding it hard to understand the "deferred antipattern". I think I understand it in principal but I haven't seen a super simple example of what a service, with a differed promise and one with ...
292
votes
13
answers
327k
views
ng-model for `<input type="file"/>` (with directive DEMO)
I tried to use ng-model on input tag with type file:
<input type="file" ng-model="vm.uploadme" />
But after selecting a file, in controller, $scope.vm.uploadme is still undefined.
How do I ...
309
votes
29
answers
851k
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 ...
1111
votes
18
answers
570k
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="...
156
votes
10
answers
445k
views
How to enable CORS in AngularJs
I have created a demo using JavaScript for Flickr photo search API.
Now I am converting it to the AngularJs.
I have searched on internet and found below configuration.
Configuration:
myApp.config(...
1132
votes
6
answers
1.0m
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 ...