3
I have a set of data that I organize through a choice, increasing or decreasing, or I can leave in the order that is already. The system works normally with the order of the elements, the problem is that the elements are only being shown when the sample order, ascending or descending, is selected in a select.
I would like to resolve the question: how to show the elements without the need to select the sample order so that this selection is actually optional?
<select ng-model="selectedChoice">
<option ng-repeat="choice in choices" value="{{choice.name}}" ng-init="Todos">{{choice.name}}</option>
</select>
<div ng-if="selectedChoice == 'Crescente'">
<div class="col-12">
<div class="col-4 ladolado" ng-repeat="organ in organs | orderBy: '+name' " ng-if="organ.attachment.url != null">
<a href="{{organ.url}}" class="decoracao section">
<img ng-src="{{organ.attachment.url}}" border="0" />
<span><br><p>{{organ.name}}</p>
<small class="zero">quantidade de serviços : {{organ.services.length}}</small>
</span>
</a>
<br/>
<br/>
</div>
</div>
<div class="col-12">
<div class="col-4 ladolado" ng-repeat="organ in organs | orderBy: '+name'" ng-if="organ.attachment.url == null">
<a href="{{organ.url}}" class="decoracao section">
<img src="/assets/layout/missing1.png" border="0" /><span><br><p>{{organ.name}}</p>
<small class="zero">quantidade de serviços : {{organ.services.length}}</small></span>
</a>
<br/>
<br/>
</div>
</div>
</div>
$scope.choices = [{
name: "Crescente"
}, {
name: "Decrescente"
}];