我在我的HTML有下拉與選擇的項目替換文本:在AngularJS
<div class="dropdown">
<button class="dropdown-toggle" type="button" data-toggle="dropdown" ng-model="yearName">Sort by year
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li ng-repeat="year in ctrl.getYear() | orderBy: videoYear">
<input type="checkbox" ng-model="ctrl.filter[year]" id='year{{$index}}' class='chk-btn styled-checkbox' />
<label for='year{{$index}}'>{{year}}</label>
</li>
</ul>
</div>
標題是「按年份排序」,但現在我想改變一個項目時,其按標題獲取。所以,如果我選擇1984年,標題應該是1984年。我該怎麼做?
謝謝。
如果它是關於按鈕的文本,然後只需更換可變文本,改變變量。 – Sergey
@謝謝你,但我認爲這不是一個答案。我需要一個解決方案,例子或方法。 –
當您選擇兩個或多個複選框時會發生什麼? –