Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
63 views

In this issue, first time it is coming into else block where downloadCsv method is getting called then rather destroy the component is again comes into if block. Somehow subscription has made twice in ...
anchal gaur's user avatar
1 vote
1 answer
389 views

I know this is possible and have seen many threads on how to do this but I can't figure out what I am doing wrong. My $rootScope variable is not appearing in my template view. .run(function($...
rolinger's user avatar
  • 3,194
-1 votes
3 answers
306 views

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('...
Sean's user avatar
  • 1,361
0 votes
1 answer
64 views

I have a simple issue I can't seem to crack. It seems like a variable in $rootScope isn't assigned when I call the next function but isn't that the point of a Promise (.then)? My stack is AngularJS ...
Sean's user avatar
  • 1,361
0 votes
2 answers
116 views

Our team is developing in ServiceNow and have a requirement to add rows from "Sending" table to "Receiving" table and delete rows from the "Receiving" table and return it back to the "Sending": We've ...
Dave's user avatar
  • 1,277
0 votes
0 answers
148 views

its like signup menu first controller gets the data from the user and after the validation it sends the data to $rootScope and broadcast it so the second controller can get it and show the data in ...
sirH's user avatar
  • 83
3 votes
2 answers
2k views

Our AngularJS project had start it's long way to the modern Angular. The ngMigration util recommend me to remove all the $rootScope dependecies because Angular doesn't contain a similar concept like $...
kirill.login's user avatar
0 votes
1 answer
132 views

I have a directive for users to like (or "fave") posts in my application. Throughout my controllers I use $rootScope.$emit('name-of-function', some-id) to update user data when they like a new post, ...
Leon's user avatar
  • 1,889
0 votes
1 answer
189 views

AngularJS UI-router has a useful parameter "fromState" which allows me to store where the user came from when they change state. I am trying to implement a system which takes the user back where they ...
Leon's user avatar
  • 1,889
0 votes
0 answers
29 views

I developed a single page website with the AngularJS framework.My website will receive logs from other servers and render them on the page. When I open two identical pages of my app in the same ...
21detective's user avatar
0 votes
2 answers
56 views

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", $...
Jordec's user avatar
  • 1,564
0 votes
1 answer
1k views

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 ...
Dave's user avatar
  • 1,277
0 votes
1 answer
83 views

Neither $rootScope.$broadcast nor $rootScope.$emit is working from my factory I have $rootScope injected into the factory. The factory returns this function: alertHook: function() { $rootScope.$...
MMelvin0581's user avatar
0 votes
2 answers
644 views

I'm relatively new in AngularJS and I have been asked to modify our application so that when the user closes the browser, we also log them out of Auth0 service. I have the code below but I can't get ...
RealSollyM's user avatar
  • 1,540
0 votes
0 answers
39 views

I'm creating an AngularJs web app and I need to know if an user enter an url in the address bar. In this case I will destroy the current context to initiate a new one. I tried to use the $rootScope.$...
Escdemon's user avatar
0 votes
0 answers
84 views

I have a parent page _jobs.html which has a ng-include <div id="jobs-details" ng-controller="JobsController as jobsCtrl"> <container container-id="jobs-details-container-portlet" ...
StrugglingCoder's user avatar
0 votes
1 answer
36 views

i use $rootScope to send data to a controller from a nested state and view It works between 'items' and rootSelector, It does not work between 'detail' and rootSelector something blocks my ...
Georg T's user avatar
1 vote
0 answers
171 views

I have an angularJS application. I have implemented a generic workflow using $routeProvider, templateUrl & Controllers. Each step(screen) is verified when user click on next button and moves to ...
Fareed's user avatar
  • 33
0 votes
1 answer
424 views

I am a newbie to AngularJs and I am building a simple AngularJs web, I have set up the page and it works as I expect. But when I try to use the rootscope variable in the script part of my index.html. ...
Qi Lin's user avatar
  • 77
0 votes
1 answer
97 views

I am trying to define an AngularJS rootscope variable in a .ASPX file to use in a TypeScript file, but I am unsure of how to do this. I am open to any way to be able to define a value in an .ASPX file ...
jkost4's user avatar
  • 73
0 votes
1 answer
1k views

In my AngularJS application, I have a controller-A and a factory. I am using the following code in factory to call the function in controller-A. In the initial call, the function in controller A's ...
Vishwa Dany's user avatar
0 votes
0 answers
838 views

Our team is building a Service Portal page in ServiceNow and have a widget that opens a Material modal window via ng-click: <md-button id="small-btn" class=" btn1" ng-click="showAdvanced($event)" &...
Dave's user avatar
  • 1,277
0 votes
2 answers
1k views

I am using angularjs and angularjs ui-route. I am building a login page and I want to prevent any user to go to inner pages without logging in. I have found a similar question but it lacks ...
cleem's user avatar
  • 75
0 votes
2 answers
234 views

I have scope value which I need in rootScope so I can use it across app, and so I did it like var app = angular.module('myApp', []); app.run(function($rootScope) { $rootScope.car= 'honda'; })...
CodeWithCoffee's user avatar
0 votes
2 answers
36 views

I'm using AngularJS, and I want to set some config vars in my controller. For example: $rootScope.config.showPosts.users = true; $rootScope.config.showPosts.businesses = false; $rootScope....
Leon's user avatar
  • 1,889
1 vote
2 answers
84 views

I want to know about the ways of saving user info. Many seniors have recommended using $cookieStore, or Authentication or etc. But how about using $rootScope? My idea is when user has logged in, ...
CRDeity's user avatar
  • 107
0 votes
1 answer
53 views

AngularJS APP I would like to understand how I can solve this issue of the infinite digest Loop, should I write a conditional? The objective is to use angular's 2-way data binding, but I need to ...
FreshOceans's user avatar
2 votes
0 answers
1k views

My application has a dashboard with some panels, each one with a chart.(I use Angular-Chart.js) Each panel is a different custom directive. I have TickService with a global tick, broadcasted each ...
DeLac's user avatar
  • 1,122
1 vote
2 answers
109 views

I have a directive for parent scope, I also have another directive for child scope. In a template, I have several parent-child scope. Like this. ParentScope1 - ChildScope1 ParentScope2 - ...
user8565199's user avatar
0 votes
0 answers
191 views

I have defined rootscope parameters in .run method as follows. ` app.run(function($rootScope,$http) { $http.get('user/getBaseinfo').then(function success(response) { $rootScope.userRole = ...
Vishal B's user avatar
  • 653
0 votes
1 answer
1k views

I have js file lets say: login.js where I have defined root scope variable and assigned some value, something like this: mainApp.controller('loginController',function($sessionStorage, $scope, $...
Raj's user avatar
  • 65
-1 votes
1 answer
406 views

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/$...
Mr.Green's user avatar
  • 274
1 vote
3 answers
1k views

Consider I have two controllers Ctrl1 and Ctrl2. On clicking a button in Ctrl1, the button in Ctrl2 should be disabled. Any sample code for this??
Akshara's user avatar
  • 137
0 votes
2 answers
322 views

I need a function where I can use $window.history.back() to be called from every view regardless of what controller is controlling that page. .run(['$rootScope', '$state', 'CommonUserModel', '...
tekin's user avatar
  • 175
0 votes
3 answers
524 views

Since $scope.$root is a reference to $rootScope and therefore the same thing, why should I bother injecting $rootScope when I need to use it if I already have access to it through $scope.$root? What ...
ross_troha's user avatar
5 votes
1 answer
24k views

I define hostService as follows. The senario is I call first hostService.addListener() in the controller, then the controller may emit a message by $rootSceop.$emit, hostService is supposed to handle ...
SoftTimur's user avatar
  • 5,770
1 vote
3 answers
2k views

I have a simple AngularJS app that has two template pages: login.html and content.html. I use ng-view and routing to dynamically load those pages into the index.html. That works fine. Here is my ...
user3362334's user avatar
  • 2,228
0 votes
1 answer
676 views

I tried to make a directive for destroying DOM elements if user doesn't have the permission to see it. I do this as follows: angular .module('digital_equation.auth') .controller('...
Alphonse's user avatar
  • 671
0 votes
1 answer
1k views

I'm relatively new to Angular and wasn't able to find an exact answer for how to inject $rootScope into a factory function that's organized like mine. So any help is appreciated. Basically, I'm just ...
Pete's user avatar
  • 123
1 vote
1 answer
64 views

I'm looking at this code that someone else wrote. This looks to me like a bad code smell. What could be a valid reason to copy a reference to angular under the $rootScope? $rootScope._ = $window....
Chris Halcrow's user avatar
2 votes
1 answer
3k views

I have a specific problem which I can't seem to crack. In html I have following code: <select ng-model="$parent.proizvod" ng-options="i.id_proizvod as i.proizvod for i in proizvodiServer"> ...
svemiracBago's user avatar
1 vote
1 answer
308 views

.run(['$rootScope', '$state', 'Session', function ($rootScope, $state, Session) { $rootScope.$on('$stateChangeStart', function (e, toState) { console.log('inside .run') if (toState....
Ashik Jyothi's user avatar
4 votes
2 answers
5k views

i have made a rootscope function in which I am actually logging out the user. But I dont know how to call it in a view . My functions is $rootScope.logout = function () { $cookies....
Usman Iqbal's user avatar
  • 2,439
0 votes
0 answers
169 views

I am working on SPA and I include HTML pages into one basic page by ng-include.Let's call this basic page as external and the included pages as internal.In an internal page I have set an input ...
user6561572's user avatar
1 vote
1 answer
769 views

I want to have particular variable for menu to know which class to be active. Up to now I know how to set variable inside ng-view but I want to keep my menu out of that view. If I set variable in ...
Sasa's user avatar
  • 563
2 votes
2 answers
977 views

As the Angular team (and severals blogs) adviced, I try to avoid using $rootScope as possible in my apps. $rootScope exists, but it can be used for evil "Of course, global state sucks and you ...
Mistalis's user avatar
  • 18.3k
1 vote
0 answers
415 views

I'm trying to check if a user has a specific role from my component's template. For example, this could be my session service : function Session() { 'ngInject'; var userRoles = {}; ...
redAce's user avatar
  • 1,838
0 votes
1 answer
169 views

I built a rest api, now it's time to handle data with angular. To do that, I built a service to make a connection to my resources. So I've : angular.module("myServiceRest", ['ngResource']) .factory(...
kabrice's user avatar
  • 1,665
-1 votes
2 answers
713 views

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........
Sa E Chowdary's user avatar
0 votes
1 answer
215 views

sorry, maybe a stupid problem, but I am still a newbie with angular. The code: -- EDIT #2 -- ----- ----- ----- ----- ----- ----- ----- MyApp.controller('DataController', ['$http', function ($...
n00n's user avatar
  • 664