Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
```ts
import { Component } from '@angular/core';
import { PickerController } from '@ionic/angular';
import { IonButton, PickerController } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonButton],
})
export class ExampleComponent {
constructor(private pickerCtrl: PickerController) {}
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
```ts
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',
styleUrls: ['example.component.css'],
imports: [IonButton, IonPickerLegacy],
})
export class ExampleComponent {
isPickerOpen = false;
Expand DownExpand Up@@ -39,7 +49,7 @@ export class ExampleComponent {
},
{
text: 'Confirm',
handler: (value) => {
handler: (value: PickerValue) => {
console.log(`You selected: ${value.languages.value}`);
},
},
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
```ts
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',
styleUrls: ['example.component.css'],
imports: [IonButton, IonPickerLegacy],
})
export class ExampleComponent {
public pickerColumns = [
Expand DownExpand Up@@ -37,7 +47,7 @@ export class ExampleComponent {
},
{
text: 'Confirm',
handler: (value) => {
handler: (value: PickerValue) => {
console.log(`You selected: ${value.languages.value}`);
},
},
Expand Down
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
```ts
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',
styleUrls: ['example.component.css'],
imports: [IonButton, IonPickerLegacy],
})
export class ExampleComponent {
public pickerColumns = [
Expand DownExpand Up@@ -67,7 +85,7 @@ export class ExampleComponent {
},
{
text: 'Confirm',
handler: (value) => {
handler: (value: PickerValue) => {
console.log(`You selected a ${value.crust.text} pizza with ${value.meat.text} and ${value.veggies.text}`);
},
},
Expand Down