下面的引导程序导航栏出现故障。单击时,“主页”,“消息”和“公共1”标签会更改为所需的深蓝色背景。
具体来说,public2,public3,public4和register选项卡仅在单击时提供阴影背景。 public2
,public3 , and
public4 is that clicking on them causes
public1 to turn deep blue, while the selected tab gets a shadow background. Similarly, when
注册is clicked, the
注册“按钮的问题被隐藏,但其他所有内容都有白色背景。
所需效果是所选/活动标签为深蓝色。 需要对下面的代码进行哪些具体更改才能使所选的标签变为深蓝色?
<ul class="nav nav-pills" role="tablist">
<li ng-class="{active:tab('home')}"><a href="/">home</a></li>
<li ng-class="{active:tab('message')}"><a href="/message">message</a></li>
<li ng-class="{active:tab('public1')}"><a href="/public1">public1</a></li>
<li ng-class="{active:tab('public2')}"><a href="/public2">public2</a></li>
<li ng-class="{active:tab('public3')}"><a href="/public3">public3</a></li>
<li ng-class="{active:tab('public4')}"><a href="/public4">public4</a></li>
<li ng-class="{active:tab('register')}"><a href="/register">register</a></li>
<li ng-show="authenticated2()"><a href="" ng-click="logout()">logout</a></li>
</ul>
tab()
控制器中的navigation.js
方法是:
$scope.tab = function(route) {
return $route.current && route === $route.current.controller;
};