I have an web application where we show a set of values on UI which has button named 'view schedule'. When clicked on 'view schedule' button, we make a redirection to viewSchedule controller which shows the ui-grid tables.
The issue is that when clicked on 'view schedule' button, the web application logs out automatically and redirected to login page.
Why routing to login page is because in app.js file, routing is made to login page in urlRouterProvider if no route is found.
I have pasted the code below:
app.js
angular.module('app').config(['$urlRouterProvider', '$httpProvider', function($urlRouterProvider, $httpProvider, IdleProvider) {
$urlRouterProvider.otherwise('/login');
}]);
HTML :
<div class="col-md-2">
<button type="button" class="btn btn-tm view-plan-btn" ng-click='approval.viewSchedule()'>View
Schedule
</button>
</div>
Controller :
me.viewSchedule = function() {
toastr.clear();
var url = $state.href('fullview.viewSchedule', {
id: campaign.campaignId
});
window.open(url, '_blank');
};