{"id":16429936,"url":"https://github.com/sheikalthaf/ngu-modal","last_synced_at":"2026-05-13T13:33:00.248Z","repository":{"id":104179145,"uuid":"106089285","full_name":"sheikalthaf/ngu-modal","owner":"sheikalthaf","description":"It is a angular modal similar to bootstrap modal","archived":false,"fork":false,"pushed_at":"2023-12-15T08:22:47.000Z","size":133,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-07T22:37:13.864Z","etag":null,"topics":["angular-modal","modal"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sheikalthaf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2017-10-07T10:25:14.000Z","updated_at":"2018-06-19T09:15:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"b2474b3e-c397-43e8-9194-6b28df9565ce","html_url":"https://github.com/sheikalthaf/ngu-modal","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheikalthaf%2Fngu-modal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheikalthaf%2Fngu-modal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheikalthaf%2Fngu-modal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sheikalthaf%2Fngu-modal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sheikalthaf","download_url":"https://codeload.github.com/sheikalthaf/ngu-modal/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240627959,"owners_count":19831600,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-modal","modal"],"created_at":"2024-10-11T08:24:58.621Z","updated_at":"2026-05-13T13:33:00.201Z","avatar_url":"https://github.com/sheikalthaf.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngu-modal\n\nIt is a angular modal similar to bootstrap modal\n\n## Installation\n\n`npm i @ngu/modal --save`\n\n## sample\n\ninclude `NguModalModule` in your module\n\n```javascript\nimport { NguModalModule } from '@ngu/modal';\n\n@NgModule({\nimports: [\n    NguModalModule\n],\n})\nexport class AppModule { }\n```\n\nThen use in your component:\n\n```javascript\nimport { Component } from '@angular/core';\nimport { NguModal, NguModalService } from '@ngu/modal';\n\n@Component({\n  selector: 'sample',\n  template: `\n    \u003cbutton (click)=\"openModal()\"\u003eopen modal\u003c/button\u003e\n    \u003cngu-modal [MIndex]=\"sampleText\"\u003e\n        ...\n\n        ...\n\n        \u003cbutton (click)=\"closeModal()\"\u003eopen modal\u003c/button\u003e\n    \u003c/ngu-modal\u003e\n  `,\n})\nexport class SampleComponent implements OnInit {\n\n  public sampleText: NguModal;\n\n  constructor(\n      private: modal: NguModalService\n  ) {}\n\n  ngOnInit() {\n    this.sampleText = {\n      id: 'sampleTextID'\n    }\n  }\n\n  openModal() {\n      this.modal.open(this.sampleText.id);\n  }\n\n  closeModal() {\n      this.modal.close(this.sampleText.id);\n  }\n\n\n}\n```\n\n## NguModal Details\n\n```javascript\nexport interface NguModal {\n  id: any;\n  backdrop?: boolean;\n  width?: Width;\n}\n\nexport interface Width {\n  xs?: string;\n  sm?: string;\n  md?: string;\n  lg?: string;\n  fixed?: string;\n}\n```\n\n| Property | Type | Required | Description |\n| --- | --- | --- | --- |\n| `width` | Object | optional | **xs** - mobile, **sm** - tablet, **md** - desktop, **lg** - large desktops `or` **fixed** - fixed width |\n| `id` | any | yes | It is used to identify the modal and it mandatory |\n| `backdrop` | boolean | optional | It is used to control the backdrop click event. By default it is `true` |\n\n## Getstarted guide\n\n### Single Modal\n\n```javascript\nimport { Component } from '@angular/core';\nimport { NguModal, NguModalService } from '@ngu/modal';\n\n@Component({\n  selector: 'sample',\n  template: `\n    \u003cbutton (click)=\"openModal()\"\u003eopen modal\u003c/button\u003e\n    \u003cngu-modal\n        [MIndex]=\"sampleText\"\n        (beforestart)=\"beforestartModal()\"\n        (afterstart)=\"afterstartModal()\"\n        (beforeend)=\"beforeendModal()\"\n        (afterend)=\"afterendModal()\"\u003e\n\n        \u003cp\u003eLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It\n        has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop\n        publishing software like Aldus PageMaker including versions of Lorem Ipsum.\u003c/p\u003e\n\n        \u003cp\u003eLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It\n        has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop\n        publishing software like Aldus PageMaker including versions of Lorem Ipsum.\u003c/p\u003e\n        \u003cbutton (click)=\"closeModal()\"\u003eopen modal\u003c/button\u003e\n    \u003c/ngu-modal\u003e\n  `,\n})\nexport class SampleComponent implements OnInit {\n\n  public sampleText: NguModal;\n\n  constructor(\n      private: modal: NguModalService\n  ) {}\n\n  ngOnInit() {\n    this.sampleText = {\n      id: 'sampleTextID'\n    }\n  }\n\n  openModal() {\n      this.modal.open(this.sampleText.id);\n  }\n\n  closeModal() {\n      this.modal.close(this.sampleText.id);\n  }\n\n  beforestartModal() {\n      console.log('beforestartModal');\n  }\n\n  afterstartModal() {\n      console.log('afterstartModal');\n  }\n\n  beforeendModal() {\n      console.log('beforeendModal');\n  }\n\n  afterendModal() {\n      console.log('afterendModal');\n  }\n\n}\n```\n\n### Multiple Modal\n\n```javascript\nimport { Component } from '@angular/core';\nimport { NguModal, NguModalService } from '@ngu/modal';\n\n@Component({\n  selector: 'sample',\n  template: `\n    \u003cbutton (click)=\"openModalOne()\"\u003eopen modal One\u003c/button\u003e\n    \u003cngu-modal\n        [MIndex]=\"sampleTextOne\"\n        (beforestart)=\"beforestartModalOne()\"\n        (afterstart)=\"afterstartModalOne()\"\n        (beforeend)=\"beforeendModalOne()\"\n        (afterend)=\"afterendModalOne()\"\u003e\n\n        \u003ch3\u003eModal One\u003c/h3\u003e\n\n        \u003cp\u003eLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It\n        has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop\n        publishing software like Aldus PageMaker including versions of Lorem Ipsum.\u003c/p\u003e\n\n        \u003cp\u003eLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It\n        has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop\n        publishing software like Aldus PageMaker including versions of Lorem Ipsum.\u003c/p\u003e\n        \u003cbutton (click)=\"closeModalOne()\"\u003eopen modal\u003c/button\u003e\n    \u003c/ngu-modal\u003e\n\n    \u003cbutton (click)=\"openModalTwo()\"\u003eopen modal Two\u003c/button\u003e\n    \u003cngu-modal\n        [MIndex]=\"sampleTextTwo\"\n        (beforestart)=\"beforestartModalTwo()\"\n        (afterstart)=\"afterstartModalTwo()\"\n        (beforeend)=\"beforeendModalTwo()\"\n        (afterend)=\"afterendModalTwo()\"\u003e\n\n        \u003ch3\u003eModal Two\u003c/h3\u003e\n\n        \u003cp\u003eLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It\n        has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop\n        publishing software like Aldus PageMaker including versions of Lorem Ipsum.\u003c/p\u003e\n\n        \u003cp\u003eLorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It\n        has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop\n        publishing software like Aldus PageMaker including versions of Lorem Ipsum.\u003c/p\u003e\n        \u003cbutton (click)=\"closeModalTwo()\"\u003eopen modal\u003c/button\u003e\n    \u003c/ngu-modal\u003e\n  `,\n})\nexport class SampleComponent implements OnInit {\n\n  public sampleTextOne: NguModal;\n  public sampleTextTwo: NguModal;\n\n  constructor(\n      private: modal: NguModalService\n  ) {}\n\n  ngOnInit() {\n    this.sampleTextOne = {\n      id: 'sampleTextIDOne'\n    }\n\n    this.sampleTextTwo = {\n      id: 'sampleTextIDTwo'\n    }\n  }\n\n  // modal One\n  openModalOne() {\n      this.modal.open(this.sampleTextOne.id);\n  }\n\n  closeModalOne() {\n      this.modal.close(this.sampleTextOne.id);\n  }\n\n  beforestartModalOne() {\n      console.log('beforestartModalOne');\n  }\n\n  afterstartModalOne() {\n      console.log('afterstartModalOne');\n  }\n\n  beforeendModalOne() {\n      console.log('beforeendModalOne');\n  }\n\n  afterendModalOne() {\n      console.log('afterendModalOne');\n  }\n\n  // modal Two\n  openModalTwo() {\n      this.modal.open(this.sampleTextTwo.id);\n  }\n\n  closeModalTwo() {\n      this.modal.close(this.sampleTextTwo.id);\n  }\n\n\n  beforestartModalTwo() {\n      console.log('beforestartModalTwo');\n  }\n\n  afterstartModalTwo() {\n      console.log('afterstartModalTwo');\n  }\n\n  beforeendModalTwo() {\n      console.log('beforeendModalTwo');\n  }\n\n  afterendModalTwo() {\n      console.log('afterendModalTwo');\n  }\n\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheikalthaf%2Fngu-modal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsheikalthaf%2Fngu-modal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsheikalthaf%2Fngu-modal/lists"}