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
If user 'touches' form inputs on profile & forgets to save: show `POP UP` when they click SideMenu icon
I've tried to come up with some sort of "error checker/validation" for my users IF they forget to Save the edits they made on their profiles.
The user enters the Profile.html state. They start to update some of their info (i.e name, phone number,…

Shotbyabel
- 273
- 1
- 6
- 18
0
votes
1 answer
How to set information into index.html outside the ng-view
I'm working with angular for the first time and having some trouble showing some dynamic information in my index.html file. Everything inside the ng-view tag is working great.
When a user authenticates, a global variable with user information is put…

Wheels
- 155
- 1
- 16
0
votes
1 answer
Cannot access $rootScope property from controller?
In angular's run block i am setting one property on $rootScope however when controller executes that property doesn't exists on $rootScope.
When application starts, in debugger i see "adal:loginSuccess" handler gets executed and $rootScope.isAdmin…

LP13
- 30,567
- 53
- 217
- 400
0
votes
1 answer
AngularJS on $stateChangeStart loop
In a web application I want that, when the user route in the $state, Angular checks if there is a token and if he has permission. But I have a problem: even if I do event.preventDefault(), it starts a loop and browser crashes. How can i prevent this…

panagulis72
- 2,129
- 6
- 31
- 71
0
votes
1 answer
How to listen to $rootscope.$broadcast with $scope
My $scope.$on(... doesn't seem to be picking up the broadcast.
I have an interceptor to capture http response errors and broadcast an event that my main controller can react to.
(function () {
'use strict';
angular
.module('app')
…

PeteGO
- 5,597
- 3
- 39
- 70
0
votes
1 answer
AngularJS 1 with TypeScript: where in controller to put $rootScope.on?
Service
export class RandomServiceName implements ng.IServiceProvider {
/* @ngInject */
constructor(private $rootScope: ng.IRootScopeService) {
}
public $get(): RandomServiceName {
return this;
}
doStuff() {
…

A T
- 13,008
- 21
- 97
- 158
0
votes
1 answer
AngularJS caching batch entity GET to individual entity services?
So I have an endpoint which returns the contents of many entities in parallel.
I have a shared service which calls this endpoint and puts them into a shared $cacheFactory.
When GET /base_entity//all route is hit first, then GET /entity/…

A T
- 13,008
- 21
- 97
- 158
0
votes
2 answers
Syntax to access rootScope variable in MyController
In the below code,