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(datetime-button): update angular to standalone #3925

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
@@ -0,0 +1,12 @@
```ts
import { Component } from '@angular/core';
import { IonDatetime, IonDatetimeButton, IonModal } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonDatetime, IonDatetimeButton, IonModal],
})
export class ExampleComponent {}
```
16 changes: 14 additions & 2 deletions static/usage/v7/datetime-button/basic/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@ import Playground from '@site/src/components/global/Playground';
import javascript from './javascript.md';
import react from './react.md';
import vue from './vue.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';

<Playground
version="7"
size="medium"
code={{ javascript, react, vue, angular }}
code={{
javascript,
react,
vue,
angular: {
files: {
'src/app/example.component.html': angular_example_component_html,
'src/app/example.component.ts': angular_example_component_ts,
},
},
}}
src="usage/v7/datetime-button/basic/demo.html"
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```ts
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
import { IonDatetime, IonDatetimeButton, IonModal } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonDatetime, IonDatetimeButton, IonModal],
// This schema is used to bypass an issue in Ionic Framework v7
// where formatOptions is not exported. Upgrade to Ionic
// Framework 8.1.1 or later to remove this workaround.
schemas: [NO_ERRORS_SCHEMA],
})
export class ExampleComponent {}
```
11 changes: 9 additions & 2 deletions static/usage/v7/datetime-button/format-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import Playground from '@site/src/components/global/Playground';
import javascript from './javascript.md';
import react from './react.md';
import vue from './vue.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';

<Playground
version="7"
Expand All @@ -12,7 +14,12 @@ import angular from './angular.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/v7/datetime-button/format-options/demo.html"
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```ts
import { Component } from '@angular/core';
import { IonDatetime, IonDatetimeButton, IonModal } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonDatetime, IonDatetimeButton, IonModal],
})
export class ExampleComponent {}
```
16 changes: 14 additions & 2 deletions static/usage/v8/datetime-button/basic/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,23 @@ import Playground from '@site/src/components/global/Playground';
import javascript from './javascript.md';
import react from './react.md';
import vue from './vue.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';

<Playground
version="8"
size="medium"
code={{ javascript, react, vue, angular }}
code={{
javascript,
react,
vue,
angular: {
files: {
'src/app/example.component.html': angular_example_component_html,
'src/app/example.component.ts': angular_example_component_ts,
},
},
}}
src="usage/v8/datetime-button/basic/demo.html"
/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```ts
import { Component } from '@angular/core';
import { IonDatetime, IonDatetimeButton, IonModal } from '@ionic/angular/standalone';

@Component({
selector: 'app-example',
templateUrl: 'example.component.html',
styleUrls: ['example.component.css'],
imports: [IonDatetime, IonDatetimeButton, IonModal],
})
export class ExampleComponent {}
```
11 changes: 9 additions & 2 deletions static/usage/v8/datetime-button/format-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import Playground from '@site/src/components/global/Playground';
import javascript from './javascript.md';
import react from './react.md';
import vue from './vue.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';

<Playground
version="8"
Expand All @@ -12,7 +14,12 @@ import angular from './angular.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/datetime-button/format-options/demo.html"
/>