English
latest (v4.7.0)

Alert CORE

Description and examples API Setup Source code
  1. Use service open method and subscribe to Observable

  2. To pass notification with custom content, you can use your template .
  3. You can also customize notification logic with a component. Inject POLYMORPHEUS_CONTEXT into the component to get context input data and to output results. It has the following interface: TuiPopover<TuiAlertOptions<I>, O> , where O is output data type and I is input data type.

  4. Use new PolymorpheusComponent(CustomNotificationComponent) to show notification component with a service:

  5. Use completeWith method to control notification from itself:

  6. If you use it from lazy loading modules, and want to reach for some local providers, you can pass Injector into new PolymorpheusComponent of your alert component.

  7. You can customize default alert options by providing TUI_ALERT_OPTIONS injection token globally across your app.