Skip to main content
The 2024 Developer Survey results are live! See the results

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.

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 ...
Mark Rajcok's user avatar
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 ...
Mark Rajcok's user avatar
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 ...
temporary_user_name's user avatar
3422 votes
30 answers
785k views

AngularJS: Service vs provider vs factory

What are the differences between a Service, Provider and Factory in AngularJS?
Lior's user avatar
  • 40.6k
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 ...
johnkeese's user avatar
  • 4,058
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?
philoniare's user avatar
  • 1,635
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) { ...
Alexei Boronine's user avatar
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 ...
Pashec's user avatar
  • 23.3k
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: ...
Swaff's user avatar
  • 13.6k
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 ...
Aleski's user avatar
  • 1,432
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 ...
Endy Tjahjono's user avatar
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 ...
Aditya Sethi's user avatar
  • 10.6k
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="...
iwein's user avatar
  • 26.1k
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(...
ankitr's user avatar
  • 6,072
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 ...
ilyo's user avatar
  • 36.2k

15 30 50 per page
1
2 3 4 5
1336