My question is very simple, but I can't get it. I have a select to order elements in AngularJS with custom options. I just need to get one option selected when the page loads.
Here's my code:
<select ng-model="sortBy">
<option value='priceOrder'>Price order</option>
<option value='price'>Price - +</option>
<option value='-price'>Price + -</option>
<option value='weight'>Weight + -</option>
<option value='-weight'>Weight - +</option>
</select>
The values comes from a Json in my controller.js
, and I ask for order in:
<li ng-repeat="item in filteredGenere | filter:query | orderBy:sortBy" >.
{{item.brand}} {{item.name}}
</li>