All Questions

925
votes
6answers
249802 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) { ang...
953
votes
15answers
477483 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="ti...
942
votes
7answers
792565 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 ch...
745
votes
23answers
369854 views

AngularJS : Prevent error $digest already in progress when calling $scope.$apply()

I'm finding that I need to update my page to my scope manually more and more since building an application in angular. The only way I know of to do this is to call $apply() from the scope of my contr...
117
votes
12answers
105798 views

Controller not a function, got undefined, while defining controllers globally

I am writing a sample application using angularjs. i got an error mentioned below on chrome browser. Error is Error: [ng:areq] http://errors.angularjs.org/1.3.0-beta.17/ng/areq?p0=ContactControl...
68
votes
5answers
82173 views

How do I share $scope data between states in angularjs ui-router?

Without using a service or constructing watchers in the parent controller, how would one give children states access to the main controller's $scope. .state("main", { controller:'mai...
338
votes
7answers
409512 views

AngularJS access parent scope from child controller

I've set up my controllers using data-ng-controller="xyzController as vm" I have a scenario with parent / child nested controllers. I have no problem accessing parent properties in the nested html by...
13
votes
3answers
38804 views

Angularjs Uncaught Error: [$injector:modulerr] when migrating to V1.3

I am learning Angular.js and I am not able to figure out whats wrong with this simple code. It seems to look fine but giving me following error. **Error**: Uncaught Error: [$injector:modulerr] http:/...
1049
votes
16answers
461503 views

How do I access the $scope variable in browser's console using AngularJS?

I would like to access my $scope variable in Chrome's JavaScript console. How do I do that? I can neither see $scope nor the name of my module myapp in the console as variables.
21
votes
1answers
14230 views

If you are not using a .(dot) in your AngularJS models you are doing it wrong?

I remember seeing this famous quote from a video on AngularJS saying that should be always using a . (dot) in your models. Well I am trying to follow this say I have var item = {} item.title ...

Previous Next