Created
April 10, 2014 22:12
-
-
Save nareeboy/10428139 to your computer and use it in GitHub Desktop.
Angular - simple data sorter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="main" ng-controller="MyController"> | |
<div class="search"> | |
<h1>Artist Search</h1> | |
<label for="">search</label> | |
<input ng-model="query" placeholder="search for artist" autofocus> | |
<label class="formgroup">By: | |
<select ng-model="artistOrder"> | |
<option value="name">Name</option> | |
<option value="reknown">reknown</option> | |
</select> | |
</label> | |
<label class="formgroup"> | |
<input type="radio" ng-model="direction" name="direction" checked> | |
ascending | |
</label> | |
<label class="formgroup"> | |
<input type="radio" ng-model="direction" name="direction" value="reverse"> | |
descending | |
</label> | |
</div> | |
<ul class="artistlist"> | |
<li class="artist cf" ng-repeat="item in artists | filter:query | orderBy: artistOrder:direction"> | |
<img ng-src="images/{{item.shortname}}_tn.jpg" alt="photo of {{item.name}}"> | |
<div class="info"> | |
<h2>{{item.name}}</h2> | |
<h3>{{item.reknown}}</h3> | |
</div> | |
</li> | |
</ul> | |
<!-- <h1>{{author.name}}</h1> --> | |
<!-- <p>{{author.title + ', ' + author.company}}</p> --> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment