import { ChangeDetectionStrategy, Component } from '@angular/core';
import { PorscheDesignSystemModule } from '@porsche-design-system/components-angular';
@Component({
selector: 'porsche-design-system-app',
template: `
Open Flyout
Some Heading
Submit
Reset
Last submitted data:
checkbox: {{checkboxValue}}
textarea: {{textareaValue}}
`,
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [PorscheDesignSystemModule],
})
export class ExampleComponent {
isFlyoutOpen = false;
checkboxValue: string = 'none';
textareaValue: string = 'none';
onOpen() {
this.isFlyoutOpen = true;
}
onDismiss() {
this.isFlyoutOpen = false;
}
onSubmit(e: Event): void {
e.preventDefault();
const formData = new FormData(e.target as HTMLFormElement);
this.checkboxValue = formData.get('some-checkbox')?.toString() || 'none';
this.textareaValue = formData.get('some-textarea')?.toString() || 'none';
}
}