I am angular newbie.I would like to achieve following code...
$routeProvider.when('/view', {templateUrl: 'ViewSwitcher?pageId='+$rootSope.pageId+'&userId='+$rootSope..userId+'&token='+$rootScope.token, controller: ''});
ViewSwitcher is a servelet which responses me a HTML page as per pageId,userId(saved in $rootScope) ......but $rootScope is not available....Thanks in advance!
You could do one thing here instead of store this variables inside the
$rootScope
useprovider
that could be easily accessible inside the config phase. Create onemyData
provider that would share a data between different components of your app.Code