+
+
+
+ To show an alert, inject the Kirby
+ AlertExperimentalController
+ in your constructor, create an
+ AlertExperimentalConfig
+ and pass it to
+ alertController.showAlert
+ .
+
+
+
+ title
+ and
+ message
+ properties in
+ AlertExperimentalConfig
+ also accept an Observable for dynamic values:
+
+
+ (see "Example on github" for implementation details of the
+ remainingSeconds$
+ timer)
+
+ :
+
+
+
+ [Optional]
+ If you need to obtain data back from the alert, you can subscribe to the
+ onWillDismiss
+ and
+ onDidDismiss
+ events like this:
+
+
+
+
Alert config properties:
+
+
diff --git a/apps/cookbook/src/app/showcase/alert-experimental-showcase/alert-experimental-showcase.component.ts b/apps/cookbook/src/app/showcase/alert-experimental-showcase/alert-experimental-showcase.component.ts
new file mode 100644
index 0000000000..2c0695588c
--- /dev/null
+++ b/apps/cookbook/src/app/showcase/alert-experimental-showcase/alert-experimental-showcase.component.ts
@@ -0,0 +1,49 @@
+import { Component } from '@angular/core';
+import {
+ AlertExperimentalExampleComponent,
+ observableCodeSnippet,
+} from '../../examples/alert-experimental-example/alert-experimental-example.component';
+import { ApiDescriptionProperty } from '../../shared/api-description/api-description-properties/api-description-properties.component';
+@Component({
+ selector: 'cookbook-alert-showcase',
+ templateUrl: './alert-experimental-showcase.component.html',
+ preserveWhitespaces: true,
+})
+export class AlertExperimentalShowcaseComponent {
+ alertConfigWithIcon: string = AlertExperimentalExampleComponent.alertConfigWithIcon;
+ alertConfigWithDynamicValues: string =
+ AlertExperimentalExampleComponent.alertConfigWithDynamicValues;
+ observableCodeSnippet: string = observableCodeSnippet;
+
+ properties: ApiDescriptionProperty[] = [
+ {
+ name: 'title',
+ description: 'The title of the alert',
+ type: ['string | Observable