Skip to content

Commit

Permalink
docs(picker-legacy): update angular to standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
brandyscarney committed Dec 26, 2024
1 parent 55a1b31 commit ad0b684
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
```ts
import { Component } from '@angular/core';
import { IonButton } from '@ionic/angular/standalone';
import { PickerController } from '@ionic/angular';
import { IonButton, PickerController } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
import { Component } from '@angular/core';
import { IonButton, IonPickerLegacy } from '@ionic/angular/standalone';

interface PickerValue {
languages: {
text: string;
value: string;
};
}

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
Expand Down Expand Up @@ -42,7 +49,7 @@ export class ExampleComponent {
},
{
text: 'Confirm',
handler: (value: any) => {
handler: (value: PickerValue) => {
console.log(`You selected: ${value.languages.value}`);
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
import { Component } from '@angular/core';
import { IonButton, IonPickerLegacy } from '@ionic/angular/standalone';

interface PickerValue {
languages: {
text: string;
value: string;
};
}

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
Expand Down Expand Up @@ -40,7 +47,7 @@ export class ExampleComponent {
},
{
text: 'Confirm',
handler: (value: any) => {
handler: (value: PickerValue) => {
console.log(`You selected: ${value.languages.value}`);
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@
import { Component } from '@angular/core';
import { IonButton, IonPickerLegacy } from '@ionic/angular/standalone';

interface PickerValue {
meat: {
text: string;
value: string;
};
veggies: {
text: string;
value: string;
};
crust: {
text: string;
value: string;
};
}

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
Expand Down Expand Up @@ -70,7 +85,7 @@ export class ExampleComponent {
},
{
text: 'Confirm',
handler: (value: any) => {
handler: (value: PickerValue) => {
console.log(`You selected a ${value.crust.text} pizza with ${value.meat.text} and ${value.veggies.text}`);
},
},
Expand Down

0 comments on commit ad0b684

Please sign in to comment.