我有一个类似的清单:
<ul>
<li><a class="group-active">Group 1</a>
<ul>
<li routerLinkActive="active"><a [routerLink]="['/group1/page1']">Group 1 - Page 1</a>
<li routerLinkActive="active"><a [routerLink]="['/group1/page2']">Group 1 - Page 2</a>
<li routerLinkActive="active"><a [routerLink]="['/group1/page3']">Group 1 - Page 3</a>
</ul>
</li>
<li><a>Group 2</a>
<ul>
<li routerLinkActive="active"><a [routerLink]="['/group2/page1']">Group 2 - Page 1</a>
<li routerLinkActive="active"><a [routerLink]="['/group2/page2']">Group 2 - Page 2</a>
<li routerLinkActive="active"><a [routerLink]="['/group2/page3']">Group 2 - Page 3</a>
</ul>
</li>
<li><a>Group 3</a>
<ul>
<li routerLinkActive="active"><a [routerLink]="['/group3/page1']">Group 3 - Page 1</a>
<li routerLinkActive="active"><a [routerLink]="['/group3/page2']">Group 3 - Page 2</a>
<li routerLinkActive="active"><a [routerLink]="['/group3/page3']">Group 3 - Page 3</a>
</ul>
</li>
</ul>
我需要:当我选择其中一个元素时,更改(第一组的)类“group-active”。他们的元素工作正常,但我无法将样式应用于相应的元素标题。
任何想法?
谢谢