I'm trying to create a modal which will maintain a state.
Whenever the child state is invoked, the parent state is loaded again (second time). Is it possible to prevent the loading of parent state when the child state is invoked?
Here is the code. Please comment if more information is necessary.
.state('parent', {
url: "/name/:id/:param1",
templateUrl: "app/partials/parent.html",
params: {
param1: {
value: null,
squash: true
}
}
})
.state('parent.child', {
url: "/:child",
template: "<div class='some_name'></div>",
onEnter: function (ngDialog, $state, $stateParams) {
ngDialog.open({
templateUrl: '/app/partials/dialog.html'
}).closePromise.then(function () {
$state.go('name', $stateParams);
});
}
});
parent.html
<a class="some_class"
ui-sref="parent.child({id: id, param1: param1?param1:null,child: 'child'})">
Open Child
</a>
I'm trying to show a modal in a child state and when the modal is closed, the app returns to the parent state.