{"id":15280545,"url":"https://github.com/lazycuh/angular-confirmation-capture","last_synced_at":"2026-02-22T20:36:59.585Z","repository":{"id":207295412,"uuid":"717919711","full_name":"lazycuh/angular-confirmation-capture","owner":"lazycuh","description":"A singleton, global Angular service to programmatically show a confirmation box to capture an user's consent","archived":false,"fork":false,"pushed_at":"2025-06-07T20:52:01.000Z","size":12801,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-22T21:01:42.196Z","etag":null,"topics":["angular","angular-confirmation","angular-confirmation-component","angular-confirmation-service","angular-confirmation-ui","confirmation-component","confirmation-service","confirmation-ui"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@lazycuh/angular-confirmation-capture","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lazycuh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-11-13T01:09:56.000Z","updated_at":"2025-07-24T14:37:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"10600785-5ba0-4a0e-9464-ad2463043cf3","html_url":"https://github.com/lazycuh/angular-confirmation-capture","commit_stats":{"total_commits":31,"total_committers":3,"mean_commits":"10.333333333333334","dds":0.5161290322580645,"last_synced_commit":"6f323cc77b2edbbd32ee193aa7ab18ec9fdf794a"},"previous_names":["babybeet/angular-confirmation-capture","lazycuh/angular-confirmation-capture"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/lazycuh/angular-confirmation-capture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lazycuh%2Fangular-confirmation-capture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lazycuh%2Fangular-confirmation-capture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lazycuh%2Fangular-confirmation-capture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lazycuh%2Fangular-confirmation-capture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lazycuh","download_url":"https://codeload.github.com/lazycuh/angular-confirmation-capture/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lazycuh%2Fangular-confirmation-capture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29726126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T20:09:16.275Z","status":"ssl_error","status_checked_at":"2026-02-22T20:09:13.750Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular-confirmation","angular-confirmation-component","angular-confirmation-service","angular-confirmation-ui","confirmation-component","confirmation-service","confirmation-ui"],"created_at":"2024-09-30T12:01:41.789Z","updated_at":"2026-02-22T20:36:59.566Z","avatar_url":"https://github.com/lazycuh.png","language":"TypeScript","readme":"# angular-confirmation-capture [![](https://circleci.com/gh/lazycuh/angular-confirmation-capture.svg?style=svg\u0026logo=appveyor)](https://app.circleci.com/pipelines/github/lazycuh/angular-confirmation-capture?branch=main)\n\nA singleton, global Angular service to programmatically show a confirmation box to capture an user's consent.\n\n## Table of contents\n\n\u003c!-- toc --\u003e\n\n- [Angular compatibility](#angular-compatibility)\n- [Installation](#installation)\n- [Available APIs](#available-apis)\n  - [`ConfirmationCaptureService`](#confirmationcaptureservice)\n  - [`ConfirmationCaptureConfiguration`](#confirmationcaptureconfiguration)\n  - [`Theme`](#theme)\n- [Example Usage](#example-usage)\n  - [Code example](#code-example)\n  - [Result](#result)\n\n\u003c!-- tocstop --\u003e\n\n## Angular compatibility\n\n| This library | Angular |\n| ------------ | ------- |\n| 3.x.x        | 20.x.x  |\n| 2.x.x        | 19.x.x  |\n| 1.x.x        | 16 - 18 |\n\n## Installation\n\n- `npm`\n  ```\n  npm i -S @lazycuh/angular-confirmation-capture\n  ```\n- `pnpm`\n  ```\n  pnpm i -S @lazycuh/angular-confirmation-capture\n  ```\n- `yarn`\n  ```\n  yarn add @lazycuh/angular-confirmation-capture\n  ```\n\n## Available APIs\n\n### `ConfirmationCaptureService`\n\nA singleton service to programmatically show a confirmation box to capture an user's consent.\n\n```ts\nclass ConfirmationCaptureService {\n  /**\n   * Set the default theme that will be used for all confirmation captures created in the future.\n   *\n   * @param theme The new theme to be used as the default.\n   */\n  static setDefaultTheme(theme: Theme): void;\n\n  /**\n   * Set the default label for the cancel button. Default is `Cancel`.\n   */\n  static setDefaultCancelButtonLabel(label: string): void;\n\n  /**\n   * Set the default label for the confirm button. Default is `Confirm`.\n   */\n  static setDefaultConfirmButtonLabel(label: string): void;\n\n  /**\n   * Open a confirmation capture using the provided configuration. Return a promise that\n   * resolves to `true` if confirm button is clicked, `false` otherwise.\n   *\n   * @param confirmationCaptureConfiguration The confirmation capture configuration object.\n   */\n  open(confirmationCaptureConfiguration: ConfirmationCaptureConfiguration): Promise\u003cboolean\u003e;\n}\n```\n\n### `ConfirmationCaptureConfiguration`\n\nThe configuration object for the confirmation capture to be created.\n\n```ts\ninterface ConfirmationCaptureConfiguration {\n  /**\n   * Whether to bypass Angular's default sanitization rules for HTML content (such as removing inline style).\n   * Default is `false`.\n   */\n  bypassHtmlSanitization?: boolean;\n\n  /**\n   * The optional label for the cancel button. Default is `Cancel`.\n   */\n  cancelButtonLabel?: string;\n\n  /**\n   * The optional class name to add for this confirmation capture.\n   */\n  className?: string;\n\n  /**\n   * The optional label for the confirm button. Default is `Confirm`.\n   */\n  confirmButtonLabel?: string;\n\n  /**\n   * The required confirmation capture's content to show. HTML is supported.\n   *\n   * If the HTML content contains inline style, it will be stripped out by Angular's default sanitization step,\n   * to bypass this behavior, pass `true` to `bypassHtmlSanitization` option.\n   */\n  content: string;\n\n  /**\n   * Whether or not the confirmation capture can be closed by clicking the backdrop.\n   */\n  dismissible?: boolean;\n\n  /**\n   * The optional theme for the floating box. Default is `light`.\n   */\n  theme?: Theme;\n}\n```\n\n### `Theme`\n\n```ts\ntype Theme = 'dark' | 'light';\n```\n\n\u003cbr/\u003e\n\n## Example Usage\n\n### Code example\n\n```typescript\n// Import the service into your class to start using it\nimport { ConfirmationCaptureService } from '@lazycuh/angular-confirmation-capture';\nimport { NotificationService } from '@lazycuh/angular-notification';\n\n@Component({\n  selector: 'test-component',\n  template: `\n    \u003cbutton\n      type=\"button\"\n      (click)=\"openConfirmationCapture()\"\u003e\n      Click me\n    \u003c/button\u003e\n  `\n})\nexport class TestComponent {\n  constructor(\n    private readonly confirmationCaptureService: ConfirmationCaptureService,\n    private readonly notificationService: NotificationService\n  ) {}\n\n  openConfirmationCapture() {\n    this.confirmationCaptureService\n      .open({\n        content: 'Do you want to proceed?'\n      })\n      .then(confirmed =\u003e {\n        if (confirmed) {\n          this.notificationService.open({\n            content: 'You clicked confirmed'\n          });\n        } else {\n          this.notificationService.open({\n            content: 'You clicked cancel'\n          });\n        }\n      });\n  }\n}\n```\n\n### Result\n\n- Dark theme\n  ![Confirmation capture example with dark theme](docs/example-1-dark-theme.gif)\n\n- Light theme\n  ![Example for notification with light theme](./docs/example-2-light-theme.gif)\n","funding_links":[],"categories":["Third Party Components"],"sub_categories":["Modals"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazycuh%2Fangular-confirmation-capture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flazycuh%2Fangular-confirmation-capture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flazycuh%2Fangular-confirmation-capture/lists"}