-
Notifications
You must be signed in to change notification settings - Fork 0
/
user.html
34 lines (31 loc) · 940 Bytes
/
user.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<div>
<h1>{{username}}</h1>
{{error}}
<img ng-src="{{user.avatar_url}}" title="{{user.name}}" /> Order:
<select ng-model="reposSortOrder">
<option value="+name">Name</option>
<option value="-stargazers_count">Stars</option>
<option value="+language">Language</option>
</select>
</div>
<table>
<thead>
<tr>
<th>Name</th>
<th>Stars</th>
<th>Language</th>
</tr>
</thead>
<tbody>
<!-- the word: reposSortOrder looks for tha value in $scope... It does
this because there are no single quotes in orderBy...
Could be like:
<tr ng-repeat = "repo in repos | orderBy:'-stargazers_count'">
-->
<tr ng-repeat="repo in repos | orderBy: reposSortOrder">
<td><a href="javascript:void(0)" ng-click="getRepoInfo(repo.name)">{{repo.name}}</a> </td>
<td>{{repo.stargazers_count}}</td>
<td>{{repo.language}}</td>
</tr>
</tbody>
</table>