AngularJS is an open-source JavaScript framework. Its goal is to augment browser-based applications with Model–View–Controller (MVC) capability, reduce the amount of JavaScript needed to make web applications functional. These type of apps are also known as Single-Page Applications
52
votes
1answer
5k 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, ...
440
votes
3answers
43k views
How do I “think in AngularJS” if I have a jQuery background?
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 ...
237
votes
3answers
49k views
Databinding in angularjs
Could someone explain to me how databinding works 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 ...
55
votes
10answers
18k views
Delaying AngularJS route change until model loaded to prevent flicker
I am wondering if there is a way (similar to Gmail) for Angular to delay showing a new route until after each model and it's data has been fetched using its respective services. For example, if there ...
16
votes
4answers
11k views
AngularJS - Processing $http response in service
I recently posted a detailed description of the issue I am facing here at SO. As I couldn't send an actual $http request, I used timeout to simulate asynchronous behavior. Data binding from my model ...
10
votes
2answers
8k views
How can I pass variables between controllers in AngularJS?
I have two angular controllers:
function Ctrl1($scope) {
$scope.prop1 = "First";
}
function Ctrl2($scope) {
$scope.prop2 = "Second";
$scope.both = Ctrl1.prop1 + $scope.prop2; //This is ...
24
votes
3answers
1k views
When writing a directive, how do I decide if a need no new scope, a new child scope, or a new isolate scope?
I'm looking for some guidelines that one can use to help determine which type of scope to use when writing a new directive. Ideally, I'd like something similar to a flowchart that walks me though a ...
5
votes
4answers
2k views
ngModel and component with isolated scope
I am creating simple ui-datetime directive. It splits javascript Date object into _date, _hours and _minutes parts. _date uses jquery ui datepicker, _hours and _minutes - number inputs.
See example: ...
35
votes
3answers
11k views
Call Angular JS from legacy code
I'm using angular to build HTML controls that interact with a legacy Flex application. All callbacks from the Flex app must be attached to the DOM window.
For example (in AS3)
...
37
votes
6answers
18k views
Can one controller call another in AngularJS?
Is it possible to have one controller use another?
For example:
This HTML document simply prints a message delivered by the MessageCtrl controller in the messageCtrl.js file.
<html ...
16
votes
3answers
7k views
How does the $resource `get` function work synchronously in AngularJS?
I was watching this AngularJS tutorial describing how to hook into Twitter with an Angular resource. (Video tutorial) Here is the resource that is set up in the example controller:
$scope.twitter = ...
27
votes
3answers
8k views
Is there a way to make AngularJS load partials in the beginning and not at when needed?
I have a route setup like this:
var myApp = angular.module('myApp', []).
config(['$routeProvider', function ($routeProvider) {
$routeProvider.
when('/landing', {
...
15
votes
2answers
6k 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) {
...
19
votes
4answers
6k views
AngularJS performs an OPTIONS HTTP request for a cross-origin resource
I'm trying to setup AngularJS to communicate with a cross-origin resource where the asset host which delivers my template files is on a different domain and therefore the XHR request that angular ...
10
votes
1answer
7k views
AngularJS + JQuery : How to get dynamic content working in angularjs
I am working on a Ajax app using both JQuery and AngularJS.
When I update content (which contains angularjs bindings) of a div using jquery html function, the angularjs bindings doesn't work.
Here ...