:각도 ui.router 동적 UI-SREF 내가 2 개 주와 응용 프로그램이
:settings
profile
- 내가 내 모든 응용 프로그램에 반복되는 링크가를
<a ui-sref="profile({id:profile.id})" ui-sref-active="active">Current state + ID</a>
ui-sref
을 어떻게 동적으로 변경할 수 있습니까? - 현재 stateParam과 함께 현재 상태를 나타 내기 위해 (id
)해결책을 찾으면
ui-sref-active
을 사용하기를 원합니다. 그래서 ng-click을 피하십시오. 이 같은.
수 너는 정교하니? 동적 변수와 stateParam 변수의 의미가 명확하지 않습니다 ... –
[this] (https://github.com/angular-ui/ui-router/wiki/URL-Routing#url-parameters) 참조 –
사용 $ state.href() 및 ng-href는 다음에서 설명합니다. [http://stackoverflow.com/questions/24349731/dynamically-set-the-value-of-u-sref-angularjs](http://stackoverflow.com)/questions/24349731/동적 설정 - 값 -의 - ui - sref - angularjs) –