Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(picker): update angular to standalone #3950

Open
wants to merge 5 commits into
base: ROU-11416
Choose a base branch
from
Open
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 number Diff line number Diff 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 number Diff line number Diff line change
@@ -1,9 +1,19 @@
```ts
import { Component } from '@angular/core';
import { IonButton, IonPicker } 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, IonPicker],
})
export class ExampleComponent {
isPickerOpen = false;
Expand Down Expand 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 number Diff line number Diff line change
@@ -1,9 +1,19 @@
```ts
import { Component } from '@angular/core';
import { IonButton, IonPicker } 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, IonPicker],
})
export class ExampleComponent {
public pickerColumns = [
Expand Down Expand 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 number Diff line number Diff line change
@@ -1,9 +1,27 @@
```ts
import { Component } from '@angular/core';
import { IonButton, IonPicker } 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, IonPicker],
})
export class ExampleComponent {
public pickerColumns = [
Expand Down Expand 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
12 changes: 12 additions & 0 deletions static/usage/v8/picker/basic/angular/example_component_ts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```ts
import { Component } from '@angular/core';
import { IonPicker, IonPickerColumn, IonPickerColumnOption } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonPicker, IonPickerColumn, IonPickerColumnOption],
})
export class ExampleComponent {}
```
11 changes: 9 additions & 2 deletions static/usage/v8/picker/basic/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Playground from '@site/src/components/global/Playground';

import javascript from './javascript.md';
import angular from './angular.md';

import angular_example_component_html from './angular/example_component_html.md';
import angular_example_component_ts from './angular/example_component_ts.md';
import react from './react.md';
import vue from './vue.md';

Expand All @@ -11,7 +13,12 @@ import vue from './vue.md';
javascript,
react,
vue,
angular,
angular: {
files: {
'src/app/example.component.html': angular_example_component_html,
'src/app/example.component.ts': angular_example_component_ts,
},
},
}}
src="usage/v8/picker/basic/demo.html"
size="medium"
Expand Down
10 changes: 10 additions & 0 deletions static/usage/v8/picker/modal/angular/example_component_ts.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
```ts
import { Component } from '@angular/core';
import {
IonButton,
IonButtons,
IonModal,
IonPicker,
IonPickerColumn,
IonPickerColumnOption,
IonToolbar,
} from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: './example.component.html',
styleUrls: ['./example.component.css'],
imports: [IonButton, IonButtons, IonModal, IonPicker, IonPickerColumn, IonPickerColumnOption, IonToolbar],
})
export class ExampleComponent {
currentValue = 'javascript';
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```ts
import { Component } from '@angular/core';
import { IonPicker, IonPickerColumn, IonPickerColumnOption } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonPicker, IonPickerColumn, IonPickerColumnOption],
})
export class ExampleComponent {}
```
11 changes: 9 additions & 2 deletions static/usage/v8/picker/prefix-suffix/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import Playground from '@site/src/components/global/Playground';

import javascript from './javascript.md';
import angular from './angular.md';

import angular_example_component_html from './angular/example_component_html.md';
import angular_example_component_ts from './angular/example_component_ts.md';
import react from './react.md';
import vue from './vue.md';

Expand All @@ -11,7 +13,12 @@ import vue from './vue.md';
javascript,
react,
vue,
angular,
angular: {
files: {
'src/app/example.component.html': angular_example_component_html,
'src/app/example.component.ts': angular_example_component_ts,
},
},
}}
src="usage/v8/picker/prefix-suffix/demo.html"
size="medium"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```ts
import { Component } from '@angular/core';
import { IonPicker, IonPickerColumn, IonPickerColumnOption } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonPicker, IonPickerColumn, IonPickerColumnOption],
})
export class ExampleComponent {}
```
2 changes: 2 additions & 0 deletions static/usage/v8/picker/theming/css-properties/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import javascript from './javascript.md';

import angular_example_component_html from './angular/example_component_html.md';
import angular_example_component_css from './angular/example_component_css.md';
import angular_example_component_ts from './angular/example_component_ts.md';

import vue from './vue.md';

Expand All @@ -25,6 +26,7 @@ import react_main_css from './react/main_css.md';
files: {
'src/app/example.component.html': angular_example_component_html,
'src/app/example.component.css': angular_example_component_css,
'src/app/example.component.ts': angular_example_component_ts,
},
},
}}
Expand Down