I have been encountering an issue with changing states between the view page and edit page using UI-Router. Here are some of the things I have attempted:
Controller:
$stateProvider
.state('showViewA', {
views: {
" ": {
template: "default.html",
controller:"DefaultController.ts"
},
"viewB@showViewA": {
template: "viewPage.html",
controller:"DefaultController.ts"
}
}
})
.state('showViewA@EditshowViewA', {
views: {
" ": {
template: "defaultEdit.html",
controller:"DefaultEditController.ts"
}
}
})
.state('showViewA@ViewshowViewA', {
views: {
" ": {
template: "defaultShow.html",
controller:"DefaultShowController.ts"
}
}
})
Within default.html
, I am only rendering the view that should be visible when initially opening the page, i.e., the edit page.
<div ui-view="showViewA"></div>
This displays the edit page. After saving changes on the edit page, I want to transition to the view page specified in state showViewA@ViewshowViewA
, but the redirect is not happening. Can you help me identify where I went wrong?