2 つのボタンがあり、両方に ui-sref-active があります。
<a class="button" ui-sref-active="button-selected" ui-sref="main">
<p>View patients</p>
</a>
<a class="button" ui-sref-active="button-selected" ui-sref="main.create">
<p>Add patients</>
</a>
とcss
.button-selected {
color: #0000FF;
}
「main.create」状態の 2 番目のボタンをクリックすると、「ボタン選択」クラスが最初のボタンから削除されないのはなぜだろうか。したがって、色 #0000FF はまだ最初のボタンに表示されています。「メイン」状態が常にアクティブであるように見えます。ルート状態だからでしょうか。回避策は何ですか?