{"id":17086017,"url":"https://github.com/ameerthehacker/ng-flash-messages","last_synced_at":"2025-04-12T21:37:22.472Z","repository":{"id":57158158,"uuid":"109944260","full_name":"ameerthehacker/ng-flash-messages","owner":"ameerthehacker","description":":boom: flash messages for angular","archived":false,"fork":false,"pushed_at":"2020-09-04T00:17:28.000Z","size":97,"stargazers_count":5,"open_issues_count":7,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-06T22:40:27.986Z","etag":null,"topics":["angular","bootstrap-styles","flash-messages"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ng-flash-messages","language":"JavaScript","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/ameerthehacker.png","metadata":{"files":{"readme":"README.MD","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T07:48:46.000Z","updated_at":"2020-05-12T18:49:14.000Z","dependencies_parsed_at":"2022-09-03T18:51:45.597Z","dependency_job_id":null,"html_url":"https://github.com/ameerthehacker/ng-flash-messages","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ameerthehacker%2Fng-flash-messages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ameerthehacker%2Fng-flash-messages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ameerthehacker%2Fng-flash-messages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ameerthehacker%2Fng-flash-messages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ameerthehacker","download_url":"https://codeload.github.com/ameerthehacker/ng-flash-messages/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637773,"owners_count":21137537,"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","bootstrap-styles","flash-messages"],"created_at":"2024-10-14T13:26:50.535Z","updated_at":"2025-04-12T21:37:22.453Z","avatar_url":"https://github.com/ameerthehacker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NgFlashMessages\n\n![npm](https://img.shields.io/npm/dm/ng-flash-messages.svg?style=for-the-badge)\n\nIt is an angular2+ flash message library with bootstrap styling and native angular animation [Demo](https://ameerthehacker.github.io/ng-flash-messages-demo/).\n\n![Demo Gif](https://raw.githubusercontent.com/ameerthehacker/ng-flash-messages-demo/master/src/assets/images/demo.gif)\n\n## Installation\n\nTo install this library, run:\n\n```bash\n$ npm install ng-flash-messages --save\n```\n\n## Importing the necessary module\n\nOnce you have installed the library with npm, you can import the library in your Angular `AppModule`:\n\n```typescript\nimport { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\n\nimport { AppComponent } from './app.component';\n\n// Import the library\nimport { NgFlashMessagesModule } from 'ng-flash-messages';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    BrowserModule,\n\n    // Specify the library as an import\n    NgFlashMessagesModule.forRoot()\n  ],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n```\n\nOnce the library is imported, you can use ng-flash-message components anywhere in the app:\n```xml\n\u003ch1\u003e\n  {{ title }}\n\u003c/h1\u003e\n\u003cng-flash-message\u003e\u003c/ng-flash-message\u003e\n```\n\n## Showing the flash message\n\nIn any of your component inject the NgFlashMessageService:\n\n```typescript\nimport { Component, OnInit } from '@angular/core';\n\nimport { NgFlashMessageService } from 'ng-flash-messages';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n  styleUrls: ['./app.component.css']\n})\nexport class AppComponent implements OnInit {\n  title = 'app';\n\n  constructor(private ngFlashMessageService: NgFlashMessageService) {\n  }\n  ngOnInit() {}\n}\n```\nThen call the showFlashMessage method in the service to show the flash message:\n\n```typescript\nimport { Component, OnInit } from '@angular/core';\n\nimport { NgFlashMessageService } from 'ng-flash-messages';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n  styleUrls: ['./app.component.css']\n})\nexport class AppComponent implements OnInit {\n  title = 'app';\n\n  constructor(private ngFlashMessageService: NgFlashMessageService) {\n  }\n  ngOnInit() {\n    this.ngFlashMessageService.showFlashMessage({\n      // Array of messages each will be displayed in new line\n      messages: [\"Yah! i'm alive\"], \n      // Whether the flash can be dismissed by the user defaults to false\n      dismissible: true, \n      // Time after which the flash disappears defaults to 2000ms\n      timeout: false,\n      // Type of flash message, it defaults to info and success, warning, danger types can also be used\n      type: 'danger'\n    });\n  }\n}\n```\n\n\n## License\n\nMIT © [Ameer Jhan](mailto:ameerjhanprof@gmail.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fameerthehacker%2Fng-flash-messages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fameerthehacker%2Fng-flash-messages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fameerthehacker%2Fng-flash-messages/lists"}