File tree Expand file tree Collapse file tree 4 files changed +44
-4
lines changed
static/usage/v8/picker-legacy Expand file tree Collapse file tree 4 files changed +44
-4
lines changed Original file line number Diff line number Diff line change 1
1
``` ts
2
2
import { Component } from ' @angular/core' ;
3
- import { PickerController } from ' @ionic/angular' ;
3
+ import { IonButton , PickerController } from ' @ionic/angular/standalone ' ;
4
4
5
5
@Component ({
6
6
selector: ' app-example' ,
7
7
templateUrl: ' example.component.html' ,
8
+ styleUrls: [' example.component.css' ],
9
+ imports: [IonButton ],
8
10
})
9
11
export class ExampleComponent {
10
12
constructor (private pickerCtrl : PickerController ) {}
Original file line number Diff line number Diff line change 1
1
``` ts
2
2
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
+ }
3
11
4
12
@Component ({
5
13
selector: ' app-example' ,
6
14
templateUrl: ' example.component.html' ,
15
+ styleUrls: [' example.component.css' ],
16
+ imports: [IonButton , IonPickerLegacy ],
7
17
})
8
18
export class ExampleComponent {
9
19
isPickerOpen = false ;
@@ -39,7 +49,7 @@ export class ExampleComponent {
39
49
},
40
50
{
41
51
text: ' Confirm' ,
42
- handler : (value ) => {
52
+ handler : (value : PickerValue ) => {
43
53
console .log (` You selected: ${value .languages .value } ` );
44
54
},
45
55
},
Original file line number Diff line number Diff line change 1
1
``` ts
2
2
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
+ }
3
11
4
12
@Component ({
5
13
selector: ' app-example' ,
6
14
templateUrl: ' example.component.html' ,
15
+ styleUrls: [' example.component.css' ],
16
+ imports: [IonButton , IonPickerLegacy ],
7
17
})
8
18
export class ExampleComponent {
9
19
public pickerColumns = [
@@ -37,7 +47,7 @@ export class ExampleComponent {
37
47
},
38
48
{
39
49
text: ' Confirm' ,
40
- handler : (value ) => {
50
+ handler : (value : PickerValue ) => {
41
51
console .log (` You selected: ${value .languages .value } ` );
42
52
},
43
53
},
Original file line number Diff line number Diff line change 1
1
``` ts
2
2
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
+ }
3
19
4
20
@Component ({
5
21
selector: ' app-example' ,
6
22
templateUrl: ' example.component.html' ,
23
+ styleUrls: [' example.component.css' ],
24
+ imports: [IonButton , IonPickerLegacy ],
7
25
})
8
26
export class ExampleComponent {
9
27
public pickerColumns = [
@@ -67,7 +85,7 @@ export class ExampleComponent {
67
85
},
68
86
{
69
87
text: ' Confirm' ,
70
- handler : (value ) => {
88
+ handler : (value : PickerValue ) => {
71
89
console .log (` You selected a ${value .crust .text } pizza with ${value .meat .text } and ${value .veggies .text } ` );
72
90
},
73
91
},
You can’t perform that action at this time.
0 commit comments