Skip to content

Commit 0cd7d57

Browse files
docs(picker): update angular to standalone (#3950)
1 parent d1bbf70 commit 0cd7d57

File tree

13 files changed

+110
-8
lines changed

13 files changed

+110
-8
lines changed

static/usage/v7/picker/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/v7/picker/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, IonPicker } 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, IonPicker],
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/v7/picker/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, IonPicker } 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, IonPicker],
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/v7/picker/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, IonPicker } 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, IonPicker],
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
},
File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
```ts
2+
import { Component } from '@angular/core';
3+
import { IonPicker, IonPickerColumn, IonPickerColumnOption } from '@ionic/angular/standalone';
4+
5+
@Component({
6+
selector: 'app-example',
7+
templateUrl: 'example.component.html',
8+
styleUrls: ['example.component.css'],
9+
imports: [IonPicker, IonPickerColumn, IonPickerColumnOption],
10+
})
11+
export class ExampleComponent {}
12+
```

static/usage/v8/picker/basic/index.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import Playground from '@site/src/components/global/Playground';
22

33
import javascript from './javascript.md';
4-
import angular from './angular.md';
4+
5+
import angular_example_component_html from './angular/example_component_html.md';
6+
import angular_example_component_ts from './angular/example_component_ts.md';
57
import react from './react.md';
68
import vue from './vue.md';
79

@@ -11,7 +13,12 @@ import vue from './vue.md';
1113
javascript,
1214
react,
1315
vue,
14-
angular,
16+
angular: {
17+
files: {
18+
'src/app/example.component.html': angular_example_component_html,
19+
'src/app/example.component.ts': angular_example_component_ts,
20+
},
21+
},
1522
}}
1623
src="usage/v8/picker/basic/demo.html"
1724
size="medium"

static/usage/v8/picker/modal/angular/example_component_ts.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
```ts
22
import { Component } from '@angular/core';
3+
import {
4+
IonButton,
5+
IonButtons,
6+
IonModal,
7+
IonPicker,
8+
IonPickerColumn,
9+
IonPickerColumnOption,
10+
IonToolbar,
11+
} from '@ionic/angular/standalone';
312

413
@Component({
514
selector: 'app-example',
615
templateUrl: './example.component.html',
716
styleUrls: ['./example.component.css'],
17+
imports: [IonButton, IonButtons, IonModal, IonPicker, IonPickerColumn, IonPickerColumnOption, IonToolbar],
818
})
919
export class ExampleComponent {
1020
currentValue = 'javascript';
File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
```ts
2+
import { Component } from '@angular/core';
3+
import { IonPicker, IonPickerColumn, IonPickerColumnOption } from '@ionic/angular/standalone';
4+
5+
@Component({
6+
selector: 'app-example',
7+
templateUrl: 'example.component.html',
8+
styleUrls: ['example.component.css'],
9+
imports: [IonPicker, IonPickerColumn, IonPickerColumnOption],
10+
})
11+
export class ExampleComponent {}
12+
```

0 commit comments

Comments
 (0)