From ca338864bf1fe90bd90a01316f74acd7faa00bc7 Mon Sep 17 00:00:00 2001 From: Nelson Martell Date: Wed, 23 Sep 2020 16:58:01 -0500 Subject: [PATCH] docs(reorder-group): add type to the event param (#22157) Improve Angular example by adding missing (`any`) typehint of the event --- core/src/components/reorder-group/readme.md | 6 ++++-- core/src/components/reorder-group/usage/angular.md | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/components/reorder-group/readme.md b/core/src/components/reorder-group/readme.md index e03b854193..5905c1f810 100644 --- a/core/src/components/reorder-group/readme.md +++ b/core/src/components/reorder-group/readme.md @@ -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) { // 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) { // Before complete is called with the items they will remain in the // order before the drag console.log('Before complete', this.items); diff --git a/core/src/components/reorder-group/usage/angular.md b/core/src/components/reorder-group/usage/angular.md index 43111202e6..f5773e44fd 100644 --- a/core/src/components/reorder-group/usage/angular.md +++ b/core/src/components/reorder-group/usage/angular.md @@ -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) { // 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) { // Before complete is called with the items they will remain in the // order before the drag console.log('Before complete', this.items);