我对角度很新。试图建立这个应用程序。
我有以下状态:
$stateProvider
.state('profile', {
url: '/profile',
templateUrl: '/static/guest/templates/profile.html',
controller: 'ProfileCtrl',
resolve: {
authenticate: redirectAfter('profile', null)
}
})
.state('profileSettings', {
url: '/settings',
templateUrl: '/static/guest/templates/profile-settings.html',
controller: 'ProfileSettingsCtrl',
resolve: {
authenticate: redirectAfter('profileSettings', null)
}
})
我的个人资料页面上有以下指向链接到设置的链接。
<a class="pull-right" ui-sref="profileSettings"><strong>Edit</strong></a>
我想知道如何在ui-sref="profileSettings"
上传递ID目标标识符,而不是/settings
该链接转到/settings#element
目标是点击该链接后,我将被带到通过id目标传递给设置网址的元素。这可能吗?我只能找到有关传递参数的信息,但没有关于id目标的信息。