Every application has a single root scope. All other scopes are descendant scopes of the root scope. Scopes provide separation between the model and the view, via a mechanism for watching the model for changes. They also provide an event emission/broadcast and subscription facility. See the developer guide on scopes.
Questions tagged [angularjs-rootscope]
152 questions
0
votes
1 answer
Use of $rootScope value module.config throwing error
this is my app.config
app.config(['$translateProvider',function ($translateProvider) {
$translateProvider.useUrlLoader('/api/sitecore/translations/get?pageName=' + $rootScope.currentPage + '&');
}
when i run this I'm getting the…

Jojo
- 403
- 5
- 16
0
votes
2 answers
$rootScope property value undefined in service
I have a table in a database that i need to access before anything else goes on in my website. The values that i get, i'll be using all throughout different controllers, directives, services etc. I thought the best place to store those values would…

Radu Andrei
- 1,075
- 10
- 19
0
votes
3 answers
angular-meteor $rootScope.currentUser is undefined
I have a fairly simple application I am building using angular-meteor. Below is my app.js file. When a user logs in, they are redirected to the home state. Usually, $rootScope.currentUser exists, and I am able to get the user data I need to display…

user2994560
- 1,269
- 4
- 18
- 30
0
votes
2 answers
AngularJS : How to update directive scope from child controllers
I have a simple parent/child controller set up as follows:
…
…

Oam Psy
- 8,555
- 32
- 93
- 157
0
votes
0 answers
Error: [$rootScope:inprog] $apply already in progress
I just tried to use 'ngTagsInput' in my angular app and the tags in the app are running fine,but sumultaneously its throwing the error in the console.Its not affecting my UI flow but yes errors are logging in the console.Why the cause and solution…

ak1111
- 107
- 11
0
votes
3 answers
How to access updated value in different page controllers?
I have a problem with getting updated value between in different page controller, Here is the situation.
page1.html
{{ version }}
page2.html

s1lam8u
- 111
- 1
- 3
- 13
0
votes
1 answer
Removing an object in AngularJS
I have a $rootScope object in AngularJS like this:
$rootScope.stuff = {
someId: {
name: "Patrick",
age: 105
},
anotherId: {
name: "Joseph",
age: 94
}
};
I have a function defined that adds objects to…

psnoonan
- 103
- 1
- 15
0
votes
1 answer
Scope value is not getting updated even though the rootscope has the value
I have view
Given my controller as
angularModule.controller("DisplayController",function($scope,$rootScope){
…

bvakiti
- 3,243
- 4
- 17
- 26
0
votes
2 answers
Reset a scope variable - Angular.js
I want to make sure that isSearchVisible scope variable will always start on false on every page change. How should I implement it?
app.controller('MainController', function($rootScope) {
$rootScope.isSearchVisible = false;
});
…

Matan Yadaev
- 3,018
- 3
- 19
- 21
-1
votes
3 answers
Async variable stored in $rootScope not available in other controllers
I am using Angular 1.x for my stack and when I make an API call and store the response in the $rootScope, it is not accessible in other controllers' view.
My controller:
angularApp.controller('mainController', ['$scope', '$rootScope', '$http',…

Sean
- 1,151
- 3
- 15
- 37
-1
votes
1 answer
How to inject dependencies into resolveRedirectTo of routeProvider in angularjs
Please help me understand with an example how to inject $rootScope into $routeProvider's resolveRedirectTo. I checked the official documentation (https://docs.angularjs.org/api/ngRoute/provider/$routeProvider) but I couldn't find a working example…

Mr.Green
- 274
- 1
- 3
- 15
-1
votes
2 answers
$root scope with same variable with different values
First of all excuse me if this doesn't make any sense.
I have a root-scope with two different values assigned in the same controller,and now i want to print those two values using that root-scope.....how can i achieve this
var app =…

Sa E Chowdary
- 2,075
- 15
- 31
-1
votes
1 answer
Cannot bind to rootscope in Angular 1.5 component
I'm in the process of eliminating the "scope soup" architecture of a legacy Angular 1.5 app following this guide: http://teropa.info/blog/2015/10/18/refactoring-angular-apps-to-components.html#replace-external-reference-with-bound-input
I'm trying…

U Avalos
- 6,538
- 7
- 48
- 81
-1
votes
1 answer
invoke a function after two events have been triggered
$scope.$on("stopSpinner", function() {
$('body').mask('hide');
});
the above code works that when stopSPinner is event is recieved, it executes. But my requirement is little more involved. I want to wait for two different events to…

josh_boaz
- 1,963
- 7
- 32
- 69
-1
votes
2 answers
Factory firing before $http request in run
How do I get the authCheck factory to fire before the "Check Login state of user" function?
I'm trying to check the state of the $rootScope on routing and http requests:
//Global Logout Function
myApp.run(function($rootScope, $http) {
…

Christian Hill
- 378
- 1
- 3
- 17