176 questions
0
votes
1
answer
232
views
$rootScope resets on navigation Angular 11 - AngularJS Hybrid
I am gradually migrating a rather large AngularJS app to Angular 11. Until now I have successfully re-written the sign-in / sign-up pages in Angular 11 and the AngularJS app is lazy loaded after ...
0
votes
1
answer
90
views
pass date between two controllers using rootscope angular js
i am using $rootScope to share my values. please check my code
user controller (user.js)
var app = angular.module('myApp', []);
app.controller('user', function($scope,$rootScope) {
$rootScope.test ...
-1
votes
1
answer
446
views
Deregister an event in AngularJS
Having a controller, MyCtrl:
class MyCtrl {
constructor($scope, $rootScope, ...) {
this.$scope = $scope;
this.$rootScope = $rootScope;
this.doThis = _debounce(this.resize....
1
vote
2
answers
52
views
Directive's $rootScope.$on event listener remanent issue
I have a directive that contains in his controller a watcher like:
$rootScope.$on('broad1', (event, args) => {
doSomething()
});
Then, I reload (with $state.go) a part of my page that ...
0
votes
2
answers
56
views
Value from $rootScope is not loaded properly
So I'm basically trying to get a property from my $rootScope when the page loads. I need this property so I can display the value in my form.
After testing this:
console.log("DEBUG $rootScope", $...
0
votes
1
answer
2k
views
ServiceNow: issue with recordWatch and $rootscope timing
Our team is developing an application in ServiceNow. We have a recordWatch on a widget that updates dynamically, but we also want to use rootscope to broadcast data to another widget and have ...
0
votes
1
answer
60
views
Angular Js - emit from $rootScope within directive
I am trying to open dialogs, which have their own Controllers, opening them through events.
My problem now is, that I am always getting
Cannot read property $emit of undefined`, because for some ...
0
votes
1
answer
58
views
Binding not working between components AngularJS
I do have a problem with bindings in AngularJS.
I created 2 components (leftForm and rightForm) those components have an input and a p element. This p element is a count number that increases when ...
0
votes
0
answers
123
views
how to access angular js $rootscope in spring java application
$rootScope.loadAccountSubjects = function() {
if($rootScope.shaAccountId == undefined || $rootScope.shaAccountId == null) {
$rootScope.shaAccountId = $("#userInfo_userAccountId").val();
...
0
votes
0
answers
98
views
AngularJS: Injecting rootScope or service variable in config
I get data from the DB and want to set inside config. Now, I get it inside $http.get in a service and store in a rootScope variable as well. How can I access inside config? I saw some examples, do I ...
2
votes
5
answers
2k
views
pass the value from one page to another using rootscope in angularJS
Login.js:
app.controller('LoginFormController', ['$scope','$http','$rootScope', '$state', function($scope, $http, $rootScope, $state) {
$scope.user = {};
$scope.authError = null;
$scope....
-1
votes
1
answer
69
views
AngularJS $scope is undefined when a function is called from HTML page not .js file
I have this: $scope.products;
I set the value on it like this: $scope.products = plans; where plans is the result I get back from a call.
If I debug, here, I have $scope and $scope.products in the ...
0
votes
1
answer
282
views
What's (technically) the difference between state management and using $rootScope in AngularJS? [duplicate]
I was using AngularJS a lot and I often read "don't over use $rootScope, it's bad practice".
Then, when React came up with the Flux pattern there was one central place for all data, which remembered ...
2
votes
1
answer
125
views
$rootScope in onExit
I want to use $rootScope.$broadcast() inside onExit when state changes.
But for this, I need to inject $rootScope in the .config(), which is not possible in angular
onExit: function () {
...
0
votes
0
answers
42
views
How to deregister $rootScope.$on in app.run
I am broadcasting an event in my app controller:
var locationSrt = location.toString();
if(locationSrt.indexOf("?RecoverPassword") !== -1) {
$rootScope.$broadcast('recover-password');
}
Then in ...