我試過在其他線程尋求這方面的幫助,但無濟於事。我知道我正在使用嵌套狀態,並嘗試絕對/相對路線,但它不會從searchResults轉換到attributeDefinition狀態。我使用的UI路由器與下列文件狀態轉變......從父狀態轉換到UI路由器子狀態的問題
<!-- index.html page -->
<div ai-body>
<!-- AngularUI View Pane -->
<div class="ai-content content" id="ai-content" ui-view></div>
</div>
//index.router.js: Routes
.state('searchResults', { //Parent state
url: "/searchResults/{app}?keyword",
templateUrl: "app/searchResults/searchResults.html",
ncyBreadcrumb: { label: 'Search Results' }
})
//Attribute Definition
.state('searchResults.attributeDefinition', { //child state
url: "/attributeDefinition/{action}",
templateUrl: "app/attributeDefinition/attributeDefinition.html",
ncyBreadcrumb: { label: 'Create Attribute Definition' }
})
<!-- searchResults state -->
<a type="button" class="btn btn-primary" ui-sref=".attributeDefinition({action: 'create'})">
Create new definition
</a>