I want to redirect a page based on condition after logged in by user at that time "varView" flag will have some values using cookies or rootScope or any other option. After that, in config while doing routing i have to check the flag and based on flag's value page should get redirect.
Here's code:
$routeProvider.when("/editTest/:testID",
{
  templateUrl: '/apps/templates/xyz/editTest.html',
               controller: 'EditTestController',
               resolve: {
    load: function (ShareData, $location) {
    var varView = 'tabPanelView'; // this value of varView will get loaded from login
    if (varView == 'tabPanelView') {
      $location.path('/editTestPageView.html');
    } else {
      $location.path('/editTestTabPanelView.html');
    }
    return ShareData.get('cEditTest');
  }
}
});
If varView == 'tabPanelView' then redirect on editTestPageView.html page else redirect it to editTestTabPanelView.html.
Actually, i have a customer form with two diff. views (2 html files) i.e. one with normal page scrollable with number of sections and other one is in Tab Panel view mode which is sections divided in tabs without scrollable.
So, the page view settings is on user's hand in admin area. User will choose which form view he wanted and according to that the page should get open.