I have a dropdown in my HTML:
<div class="dropdown">
<button class="dropdown-toggle" type="button" data-toggle="dropdown" ng-model="yearName">Filter 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>
The current title is 'Filter by year', however, I want it so that when an item is changed, the title reflects the selected year. For example, if 1984 is selected, the title should change to 1984. How can I achieve this?
Thank you.