1
我使用角UI路由器0.2.15並有一個頁面/profile文件現在想編輯按鈕和鏈接的點擊輪廓變得/型材/編輯。父模板也顯示在子狀態。如何擺脫這個問題?
現在我named views和UI路由器的嵌套視圖概念之間有點困惑,並與他們兩個嘗試,但問題仍然存在。
使用嵌套狀態
.state("profile", { url: '/profile', controller: 'UserController', controllerAs: 'vm', templateUrl: 'app/views/user/profile.html', data: { requiresAuth: true, pageTitle: 'Profile' } }) .state("edit", { url: '/edit', parent:'profile', templateUrl: 'app/views/user/edit_profile.html', data: { requiresAuth: true, pageTitle: 'Edit Profile' } })
和profile.html
<div ui-view=""></div>
<button type="button" class="btn fa fa-pencil" ui-sref="edit"></button>
在這種情況下,我的問題是,當我編輯網頁上點擊,它也也顯示父視圖的內容。如何處理這個?