docs(refresher): update usage example content

This commit is contained in:
Brandy Carney
2018-07-09 18:37:21 -04:00
parent 8923aa7351
commit c9d5f3d379
2 changed files with 27 additions and 9 deletions

View File

@ -1,23 +1,42 @@
```html ```html
<!-- Default Refresher -->
<ion-content> <ion-content>
<ion-refresher (ionRefresh)="doRefresh($event)"> <ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content></ion-refresher-content> <ion-refresher-content></ion-refresher-content>
</ion-refresher> </ion-refresher>
</ion-content> </ion-content>
<!-- Custom Refresher Content -->
<ion-content>
<ion-refresher slot="fixed" (ionRefresh)="doRefresh($event)">
<ion-refresher-content
pullingIcon="arrow-dropdown"
pullingText="Pull to refresh"
refreshingSpinner="circles"
refreshingText="Refreshing...">
</ion-refresher-content>
</ion-refresher>
</ion-content>
``` ```
```typescript ```typescript
@Component({...}) import { Component } from '@angular/core';
export class NewsFeedPage {
@Component({
selector: 'refresher-example',
templateUrl: 'refresher-example.html',
styleUrls: ['./refresher-example.css'],
})
export class RefresherExample {
constructor() {}
doRefresh(event) { doRefresh(event) {
console.log('Begin async operation', refresher); console.log('Begin async operation');
setTimeout(() => { setTimeout(() => {
console.log('Async operation has ended'); console.log('Async operation has ended');
event.target.complete(); event.target.complete();
}, 2000); }, 2000);
} }
} }
``` ```

View File

@ -1,13 +1,12 @@
```html ```html
<!-- Default Refresher -->
<ion-content> <ion-content>
<ion-refresher slot="fixed"> <ion-refresher slot="fixed">
<ion-refresher-content> <ion-refresher-content></ion-refresher-content>
</ion-refresher-content>
</ion-refresher> </ion-refresher>
</ion-content> </ion-content>
<!-- or for custom content --> <!-- Custom Refresher Content -->
<ion-content> <ion-content>
<ion-refresher slot="fixed"> <ion-refresher slot="fixed">
<ion-refresher-content <ion-refresher-content