My code has the following:
var app = angular.module('app', ['admin', 'home', 'questions', 'ui.compat', 'ngResource', 'LocalStorageModule']); app.run(['$rootScope', '$state', '$stateParams', function ($rootScope, $state, $stateParams) { $rootScope.$state = $state; $rootScope.$stateParams = $stateParams; $state.transitionTo('home'); }]);
Can someone explain what the two lines starting with $ rootScope do. Are they needed?
source share