|
3 | 3 | component: collectionRepeat
|
4 | 4 | ---
|
5 | 5 |
|
6 |
| -<div ng-controller="ContactsCtrl"> |
| 6 | +<div ng-controller="MainCtrl" ng-app="contactsApp"> |
7 | 7 | <ion-header-bar class="bar-positive">
|
8 |
| - <h1 class="title">1000 Contacts</h1> |
9 |
| - <div class="button" ng-click="scrollBottom()"> |
10 |
| - Bottom |
11 |
| - </div> |
| 8 | + <h1 class="title">3000 Contacts B</h1> |
| 9 | + <button class="button clear" ng-click="data.search = ''">Clear</button> |
12 | 10 | </ion-header-bar>
|
13 |
| - <ion-header-bar class="bar-light bar-subheader"> |
14 |
| - <input type="search" |
15 |
| - placeholder="Filter contacts..." |
16 |
| - ng-model="search" |
17 |
| - ng-change="scrollTop()"> |
18 |
| - <button ng-if="search.length" |
19 |
| - class="button button-icon ion-android-close input-button" |
20 |
| - ng-click="clearSearch()"> |
21 |
| - </button> |
| 11 | + <ion-header-bar class="bar-subheader item-input-inset"> |
| 12 | + <label class="item-input-wrapper"> |
| 13 | + <input type="text" ng-model="data.search" placeholder="Filter Contacts..." type="search"> |
| 14 | + </label> |
22 | 15 | </ion-header-bar>
|
23 |
| - <ion-content> |
24 |
| - <div class="list"> |
25 |
| - <a class="item contact-item" |
26 |
| - collection-repeat="item in getContacts()" |
27 |
| - collection-item-height="getItemHeight(item)" |
28 |
| - collection-item-width="100 + '%'" |
29 |
| - ng-style="{'line-height': getItemHeight(item) + 'px'}" |
30 |
| - ng-class="{'item-divider': item.isLetter}"> |
31 |
| - <i ng-if="!item.isLetter" class="icon" ng-class="['ion-ios7-person','ion-person','ion-android-contact','ion-android-social-user','ion-person-stalker'][$index % 5]"></i> |
32 |
| - {{item.letter || (item.first_name+' '+item.last_name)}} |
33 |
| - </a> |
| 16 | + <ion-content direction="y"> |
| 17 | + <ion-list> |
| 18 | + <div collection-repeat="item in contacts | filter:data.search | orderBy:'last_name' | ionLetterDividers:'last_name'" |
| 19 | + divider-collection-repeat |
| 20 | + force-refresh-images> |
| 21 | + <ion-item> |
| 22 | + <h2>{{item.first_name+' '+item.last_name}}</h2> |
| 23 | + <p>{{$index}}</p> |
| 24 | + </ion-item> |
| 25 | + </ion-item> |
34 | 26 | </div>
|
35 | 27 | </ion-content>
|
36 | 28 | </div>
|
| 29 | +<script> |
| 30 | +</script> |
| 31 | +</body> |
| 32 | +</html> |
0 commit comments