{"id":15383639,"url":"https://github.com/knownasilya/ember-toastr","last_synced_at":"2025-09-15T00:31:03.959Z","repository":{"id":35369170,"uuid":"39632124","full_name":"knownasilya/ember-toastr","owner":"knownasilya","description":"Wrapper for Toastr.js notifications","archived":false,"fork":false,"pushed_at":"2023-01-06T21:34:49.000Z","size":3518,"stargazers_count":45,"open_issues_count":5,"forks_count":16,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-03T04:44:38.316Z","etag":null,"topics":["ember-addon","notifications","toastr","ui"],"latest_commit_sha":null,"homepage":"http://knownasilya.github.io/ember-toastr/","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/knownasilya.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-24T12:35:44.000Z","updated_at":"2024-08-21T18:02:36.000Z","dependencies_parsed_at":"2023-01-15T19:30:28.721Z","dependency_job_id":null,"html_url":"https://github.com/knownasilya/ember-toastr","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knownasilya%2Fember-toastr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knownasilya%2Fember-toastr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knownasilya%2Fember-toastr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/knownasilya%2Fember-toastr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/knownasilya","download_url":"https://codeload.github.com/knownasilya/ember-toastr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233048136,"owners_count":18616988,"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":["ember-addon","notifications","toastr","ui"],"created_at":"2024-10-01T14:39:03.310Z","updated_at":"2025-01-08T14:55:39.048Z","avatar_url":"https://github.com/knownasilya.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ember-toastr\n\nA service wrapper for [toastr.js] with auto injection into routes, components, and controllers.\n\n[![npm version](https://badge.fury.io/js/ember-toastr.svg)](http://badge.fury.io/js/ember-toastr)\n[![Build Status](https://travis-ci.org/knownasilya/ember-toastr.svg)](https://travis-ci.org/knownasilya/ember-toastr)\n[![Ember Observer Score](http://emberobserver.com/badges/ember-toastr.svg)](http://emberobserver.com/addons/ember-toastr)\n\n## Compatibility\n\n- Ember.js v3.12 or above\n- Ember CLI v2.13 or above\n- Node.js v10 or above\n- Requires jQuery (see https://github.com/emberjs/ember-jquery)\n\n## Usage\n\n```sh\nember install ember-toastr\n```\n\nYou can now access the notifications service as `toast`.\nYou can inject it in routes, controllers or components using the following syntax:\n\n```js\nimport Controller from '@ember/controller';\nimport { inject as service } from '@ember/service';\nimport { action } from '@ember/object';\n\nexport default class SomeController extends Controller {\n  @service toast;\n\n  @action\n  test() {\n    let title = 'Test';\n    let message = 'A test happened';\n\n    this.toast.info(message, title, {\n      // options here\n    });\n  }\n}\n```\n\n\u003e If using newer versions of Ember you can inject using the decorator syntax, see the Ember documentation for @ember/service#inject decorator.\n\nYou can also use `toast.clear()` and `toast.remove()` to\nremove all toasts. For example:\n\n```hbs\n\u003cbutton {{on \"click\" this.toast.clear}}\u003eClear\u003c/button\u003e\n```\n\nSee the toastr.js [demo] for other possible uses, and the [toastr.js documentation]\nfor explanation of options.\n\n## API\n\n### `toast` Service\n\n#### `success(msg = '', title = '', options = {})`\n\nA method with the above default values for displaying a success toast.\n\n#### `info(msg = '', title = '', options = {})`\n\nA method with the above default values for displaying a info toast.\n\n#### `warning(msg = '', title = '', options = {})`\n\nA method with the above default values for displaying a warning toast.\n\n#### `error(msg = '', title = '', options = {})`\n\nA method with the above default values for displaying an error toast.\n\n#### `clear()` or `clear(toast)`\n\nA method to clear all toasts, or the individual toast.\n\n#### `remove()` or `remove(toast)`\n\nA method to remove all toasts, or the individual toast.\n\n#### `toasts`\n\nA property to access all toasts that are added.\n\n## Configuration\n\nThese are the default options:\n\n```js\nENV['ember-toastr'] = {\n  toastrOptions: {\n    closeButton: true,\n    debug: false,\n    newestOnTop: true,\n    progressBar: true,\n    positionClass: 'toast-top-right',\n    preventDuplicates: true,\n    onclick: null,\n    showDuration: '300',\n    hideDuration: '1000',\n    timeOut: '4000',\n    extendedTimeOut: '1000',\n    showEasing: 'swing',\n    hideEasing: 'linear',\n    showMethod: 'fadeIn',\n    hideMethod: 'fadeOut',\n  },\n};\n```\n\nAll options in `toastrOptions` are direct options for toastr.js.\n\n## Testing Toasts in Acceptance Tests\n\nToastr messages are rendered inside a `div#toast-container`, but outside of `div#ember-testing-container`, where all of the testing action takes place.\nTherefore, you need to supply a second scope parameter of `document` to your `assert.dom(...)` calls.\n\nFor example: `assert.dom('#toast-container', document).includesText('ERROR: Invalid username or password')`;\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n[toastr.js]: https://github.com/CodeSeven/toastr\n[toastr.js documentation]: https://github.com/CodeSeven/toastr#other-options\n[demo]: http://codeseven.github.io/toastr/demo.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknownasilya%2Fember-toastr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fknownasilya%2Fember-toastr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fknownasilya%2Fember-toastr/lists"}