When I click on the link << Add Call >>
the modal is opened with custom URL but in the background is a blank view, I want the previous state to still appearing behind the modal when opened
header.html
<li><a ui-sref="new-call">Add Call</a></li>
app.js
.state('new-call', {
url: '/new-call',
resolve: {
PreviousState: [
"$state",
function ($state) {
var currentStateData = {
Name: $state.current.name,
Params: $state.params,
URL: $state.href($state.current.name, $state.params)
};
return currentStateData;
}
]
},
onEnter: ['PreviousState', '$stateParams', '$state', '$modal', '$location',
function(PreviousState, $stateParams, $state, $modal, $location){
$modal.open({
templateUrl: 'views/new-call.html',
controller: 'NewCallCtrl'
}).result.finally(function(){
$state.go(PreviousState.Name, PreviousState.Params);
});
console.log($stateParams);
}]
})