Skip to content

Commit 04c2c28

Browse files
docs(picker-legacy): update angular to standalone (#3951)
1 parent 4fb2cd1 commit 04c2c28

File tree

4 files changed

+44
-4
lines changed

4 files changed

+44
-4
lines changed

static/usage/v8/picker-legacy/controller/angular/example_component_ts.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
```ts
22
import { Component } from '@angular/core';
3-
import { PickerController } from '@ionic/angular';
3+
import { IonButton, PickerController } from '@ionic/angular/standalone';
44

55
@Component({
66
selector: 'app-example',
77
templateUrl: 'example.component.html',
8+
styleUrls: ['example.component.css'],
9+
imports: [IonButton],
810
})
911
export class ExampleComponent {
1012
constructor(private pickerCtrl: PickerController) {}

static/usage/v8/picker-legacy/inline/isOpen/angular/example_component_ts.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
```ts
22
import { Component } from '@angular/core';
3+
import { IonButton, IonPickerLegacy } from '@ionic/angular/standalone';
4+
5+
interface PickerValue {
6+
languages: {
7+
text: string;
8+
value: string;
9+
};
10+
}
311

412
@Component({
513
selector: 'app-example',
614
templateUrl: 'example.component.html',
15+
styleUrls: ['example.component.css'],
16+
imports: [IonButton, IonPickerLegacy],
717
})
818
export class ExampleComponent {
919
isPickerOpen = false;
@@ -39,7 +49,7 @@ export class ExampleComponent {
3949
},
4050
{
4151
text: 'Confirm',
42-
handler: (value) => {
52+
handler: (value: PickerValue) => {
4353
console.log(`You selected: ${value.languages.value}`);
4454
},
4555
},

static/usage/v8/picker-legacy/inline/trigger/angular/example_component_ts.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
```ts
22
import { Component } from '@angular/core';
3+
import { IonButton, IonPickerLegacy } from '@ionic/angular/standalone';
4+
5+
interface PickerValue {
6+
languages: {
7+
text: string;
8+
value: string;
9+
};
10+
}
311

412
@Component({
513
selector: 'app-example',
614
templateUrl: 'example.component.html',
15+
styleUrls: ['example.component.css'],
16+
imports: [IonButton, IonPickerLegacy],
717
})
818
export class ExampleComponent {
919
public pickerColumns = [
@@ -37,7 +47,7 @@ export class ExampleComponent {
3747
},
3848
{
3949
text: 'Confirm',
40-
handler: (value) => {
50+
handler: (value: PickerValue) => {
4151
console.log(`You selected: ${value.languages.value}`);
4252
},
4353
},

static/usage/v8/picker-legacy/multiple-column/angular/example_component_ts.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
```ts
22
import { Component } from '@angular/core';
3+
import { IonButton, IonPickerLegacy } from '@ionic/angular/standalone';
4+
5+
interface PickerValue {
6+
meat: {
7+
text: string;
8+
value: string;
9+
};
10+
veggies: {
11+
text: string;
12+
value: string;
13+
};
14+
crust: {
15+
text: string;
16+
value: string;
17+
};
18+
}
319

420
@Component({
521
selector: 'app-example',
622
templateUrl: 'example.component.html',
23+
styleUrls: ['example.component.css'],
24+
imports: [IonButton, IonPickerLegacy],
725
})
826
export class ExampleComponent {
927
public pickerColumns = [
@@ -67,7 +85,7 @@ export class ExampleComponent {
6785
},
6886
{
6987
text: 'Confirm',
70-
handler: (value) => {
88+
handler: (value: PickerValue) => {
7189
console.log(`You selected a ${value.crust.text} pizza with ${value.meat.text} and ${value.veggies.text}`);
7290
},
7391
},

0 commit comments

Comments
 (0)