0
我想從一個頁面導航到另一個頁面,並在另一個頁面上點擊按鈕時指定的元素。我怎樣才能做到這一點 ?導航到另一個頁面和特定元素Angularjs
我的場景:index.html和periodical.html是兩個文件,periodical.html有多個元素。現在,在index.html的點擊按鈕,我想直接導航至Periodical.html.I特定元素正在使用$stateProvider
和$urlRouterProvider
我的狀態(工作正常,直到導航到periodical.html):
.state('page.periodical', {
url: '/periodical',
controller: 'PeriodicalController',
controllerAs: 'periodical',
templateUrl: 'app/components/page/periodical/periodical.html',
data: {
pageTitle: 'Periodical page',
dashboard: 'periodical'
}
})
我正在從index.html控制器中做$state.go('page.periodical');
,它工作正常。我怎樣才能達到$state.go('page.periodical#rt_page_element1');
?這是導致錯誤,但元素參考#rt_page_element1
是正確的。
它不應該像 $ state.go('page.periodical #rt_page_element1' ); ? –
對不起,這是一個錯字,編輯了這個問題 – Srini