我想實現僅在點擊後應該完全可見的列表。 但是,當我嘗試在ng-click
上設置值時,值範圍僅在點擊元素上。無法在ng-reapeat中設置AngularJS變量
<ul data-ng-init="showIataList = false">
{{showIataList}} <-- always false :(but should be true after click on link from list
<li data-ng-repeat="value in data.departureIataList">
<a href="javascript:"
data-ng-if="$index < 3 || showIataList">
{{value}}
</a>
{{showIataList}}
<a href="javascript:"
data-ng-if="!showIataList && $index == 3"
data-ng-click="showIataList = true">
{{showIataList}} <-- after click is true, but true should be and on the top showIataList variable
</a>
</li>
</ul>