我有类似的HTML ...
<ul id="sidemenu" class="wraplist wrapper-menu">
<li class="auto" ng-class='{"active": active == 1 }' ng-click="makeActive(1)">
<span class="arrow material-icons">arrow_down</span>
<li>
<li class="auto" ng-class='{"active": active == 2 }' ng-click="makeActive(2)">
<span class="arrow material-icons">arrow_down</span>
<li>
<ul>
在ng-click = makeActive()上,我只想将特定
最佳答案
keyboardArrow只引用一个变量。因此,您必须创建两个范围变量:keyboardArrow1
和keyboardArrow2
<ul id="sidemenu" class="wraplist wrapper-menu">
<li class="auto" ng-class='{"active": active == 1 }' ng-click="makeActive(1)">
<span class="arrow material-icons">{{ keyboardArrow1 }}</span>
<li>
<li class="auto" ng-class='{"active": active == 2 }' ng-click="makeActive(2)">
<span class="arrow material-icons">{{ keyboardArrow2 }}</span>
<li>
<ul>
更新资料
根据您的需要,这里是plunker。
关于javascript - 使用angularjs更改li中的跨度文本,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41823969/