使用角度

时间:2017-12-08 10:16:26

标签: html angularjs servicenow

角度标签更改新值?

<ul class="nav nav-tabs">
    <li class="active">
        <a class="A" data-target="#A">Nye({{c.data.feil_nye_ant}})</a>
    </li>
    <li class="nav">
        <a class="B" data-target="#B">Aktive({{c.data.feil_aktive_ant}})</a>
    </li>
    <li class="nav">
        <a class="C" data-target="#C">HASTER({{c.data.feil_haster_ant}})</a>
    </li>
    <li class="nav">
        <a class="D" data-target="#D">Ferdige({{c.data.feil_ferdig_ant}})</a>
    </li>
</ul>

当更新c.data.feil_haster_ant的值时,需要通过打开“HASTER”选项卡(表示“紧急”)来绘制焦点。

1 个答案:

答案 0 :(得分:1)

您可以使用ng-class激活标签页。在选项卡上执行事件(如单击)时,请使用ng-class设置某个条件的值以触发该选项卡的css更改。

<强> HTML

<ul class="nav nav-tabs">
    <li class="active"  ng-class="{'active': Some condition}">
        <a class="A" data-target="#A">Nye({{c.data.feil_nye_ant}})</a>
    </li>
    <li class="nav"  ng-class="{'active': Some condition}">
        <a class="B" data-target="#B">Aktive({{c.data.feil_aktive_ant}})</a>
    </li>
    <li class="nav"  ng-class="{'active': Some condition}">
        <a class="C" data-target="#C">HASTER({{c.data.feil_haster_ant}})</a>
    </li>
    <li class="nav"  ng-class="{'active': Some condition}">
        <a class="D" data-target="#D">Ferdige({{c.data.feil_ferdig_ant}})</a>
    </li>
</ul>

<强> CSS

.active{
 your css styles for active tab 
}