如何指定一个 class 到匹配当前 angular 路由的标签
How to specify a class to A tag that matches the current angular route
当当前 ngroute 与 a 标签 href 匹配时,如何将 class 放在 <A>
标签上。我知道 ui-router 中有 ui-active 但我正在使用 ngroute.
我做了一个 github 项目来解决您的问题。
https://github.com/ionescuvictor/ngRoute-active-directive
<a route-active="active" href="/#/Test" ></a>
变成了
<a class='active' href="/#/Test"></a>
当当前 ngroute 与 a 标签 href 匹配时,如何将 class 放在 <A>
标签上。我知道 ui-router 中有 ui-active 但我正在使用 ngroute.
我做了一个 github 项目来解决您的问题。
https://github.com/ionescuvictor/ngRoute-active-directive
<a route-active="active" href="/#/Test" ></a>
变成了
<a class='active' href="/#/Test"></a>