docs(reorder-group): add type to the event param (#22157)

Improve Angular example by adding missing (`any`) typehint of the event
This commit is contained in:
Nelson Martell
2020-09-23 16:58:01 -05:00
committed by GitHub
parent a24a041064
commit ca338864bf
2 changed files with 8 additions and 4 deletions

View File

@ -88,6 +88,7 @@ The `detail` property of the `ionItemReorder` event includes all of the relevant
```javascript
import { Component, ViewChild } from '@angular/core';
import { IonReorderGroup } from '@ionic/angular';
import { ItemReorderEventDetail } from '@ionic/core';
@Component({
selector: 'reorder-group-example',
@ -99,7 +100,7 @@ export class ReorderGroupExample {
constructor() {}
doReorder(ev: any) {
doReorder(ev: CustomEvent<ItemReorderEventDetail>) {
// The `from` and `to` properties contain the index of the item
// when the drag started and ended, respectively
console.log('Dragged from index', ev.detail.from, 'to', ev.detail.to);
@ -121,6 +122,7 @@ export class ReorderGroupExample {
```javascript
import { Component, ViewChild } from '@angular/core';
import { IonReorderGroup } from '@ionic/angular';
import { ItemReorderEventDetail } from '@ionic/core';
@Component({
selector: 'reorder-group-example',
@ -134,7 +136,7 @@ export class ReorderGroupExample {
constructor() {}
doReorder(ev: any) {
doReorder(ev: CustomEvent<ItemReorderEventDetail>) {
// Before complete is called with the items they will remain in the
// order before the drag
console.log('Before complete', this.items);

View File

@ -72,6 +72,7 @@
```javascript
import { Component, ViewChild } from '@angular/core';
import { IonReorderGroup } from '@ionic/angular';
import { ItemReorderEventDetail } from '@ionic/core';
@Component({
selector: 'reorder-group-example',
@ -83,7 +84,7 @@ export class ReorderGroupExample {
constructor() {}
doReorder(ev: any) {
doReorder(ev: CustomEvent<ItemReorderEventDetail>) {
// The `from` and `to` properties contain the index of the item
// when the drag started and ended, respectively
console.log('Dragged from index', ev.detail.from, 'to', ev.detail.to);
@ -105,6 +106,7 @@ export class ReorderGroupExample {
```javascript
import { Component, ViewChild } from '@angular/core';
import { IonReorderGroup } from '@ionic/angular';
import { ItemReorderEventDetail } from '@ionic/core';
@Component({
selector: 'reorder-group-example',
@ -118,7 +120,7 @@ export class ReorderGroupExample {
constructor() {}
doReorder(ev: any) {
doReorder(ev: CustomEvent<ItemReorderEventDetail>) {
// Before complete is called with the items they will remain in the
// order before the drag
console.log('Before complete', this.items);