{"_id":"6px-alert-service","_rev":"2-540c3fd60de08f02b6420e958a455448","name":"6px-alert-service","description":"Alert service for Angular 4+ using 6pixels UI","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"6px-alert-service","version":"0.0.1","description":"Alert service for Angular 4+ using 6pixels UI","main":"bundles/6px-angular-alert-service.umd.js","module":"index.js","typings":"index.d.ts","scripts":{},"keywords":["angular"],"author":{"name":"Jason Jacobson"},"contributors":[],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/xjdesigns/angular-alert-service.git"},"homepage":"https://github.com/xjdesigns/angular-alert-service","bugs":{"url":"https://github.com/xjdesigns/angular-alert-service/issues"},"peerDependencies":{"@angular/core":"~4.0.0","@angular/router":"~4.0.0","@angular/common":"~4.0.0","@angular/platform-browser":"~4.0.0","reflect-metadata":"^0.1.8","rxjs":"^5.0.3","zone.js":"^0.7.2"},"_id":"6px-alert-service@0.0.1","_shasum":"66bd2023cd6898bd28e039672e771c1cc92172cc","_from":".","_npmVersion":"3.10.9","_nodeVersion":"6.0.0","_npmUser":{"name":"jdesign_jason","email":"jdesigns.jason@gmail.com"},"dist":{"shasum":"66bd2023cd6898bd28e039672e771c1cc92172cc","tarball":"https://registry.npmjs.org/6px-alert-service/-/6px-alert-service-0.0.1.tgz","integrity":"sha512-bBHE6XkjQj0YvKzVgsO2rStrWxXWflqTnK0OaW2JuhGr4goxZ+wDKFYKCAo7wHEnh5DQddNcrWBn+ZOX9Ar1gQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICPUXZGTSqmnAJg96ADdamZxhJngES2V1Cx98CPqAKHsAiEA9dtrWsG+Mjy/c5KqGvSpNtUsw5a45rU+isHt+xU6zY4="}]},"maintainers":[{"name":"jdesign_jason","email":"jdesigns.jason@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/6px-alert-service-0.0.1.tgz_1514750490638_0.8178983409889042"}}},"readme":"# 6px Angular Alert Service\n\n> A start for Angular modules\n\n## Getting started\n\nThis provides a alert service for use with Angular 4+ apps using 6px UI. All files you need live in /src.\n\nNote: There is a `package.json` file inside of the `/dist` which is needed for publishing.\n\nOnce you have cloned the repo. From the root you can run `npm run build`. This will run scripts to cleanup, ngc, bundle, minify, and copy.\n\n### Publish\nTo publish to npm you set this up, then run `npm run npm-to-publish`.\nThis uses the package noted above.\n\n# Local development\nTo develop locally you want to do the following:\n\n`npm run build`\n\n`cd dist/`\n\n`npm link`\n\nThis creates a symlink to your global node_modules. Then from your working directory:\n\n`npm link 6px-alert-service`\n\nOnce you are linked to your local copy of the module. In your `systemjs.config.js` file you need to add you mapping.\n```javascript\n\nmap: {\n  app: 'app',\n  // angular bundles\n  ...\n  '6px-alert-service': 'node_modules/6px-alert-service/bundles/6px-angular-alert-service.umd.js'\n}\n```\n> NOTE: The name of your bundle is created inside your `rollup.config.js` file. Rollup us used for creating the umd module.\n\nThen add this to your app.module.ts file.\n```javascript\n\nimport { SpxAlertServiceModule } from '6px-alert-service';\n\n@NgModule({\n  imports: [\n    SpxAlertServiceModule\n    ...\n  ]\n})\n```\n\nAdd the tag to your root .html file, this displays your alerts.\n```html\n\n<spx-alert></spx-alert>\n```\n\nNow you can use this inside your application by importing the service and calling it's methods.\n```javascript\n\nAdd an alert:\n@params message: string\n@params type: string['success', 'fail', 'info']\n@params callback: Function\naddAlert(message, type, callback);\n\n\nRemove an alert:\n@params index: number\nremoveAlertByIndex(index);\n\n\nClear all:\nclearAll();\n```\n\n\nExample -\n``` javascript\n\nimport { SpxAlertService } from '6px-alert-service';\n\nexport class AppComponent {\n  constructor(private spxAlert: SpxAlertService) {}\n\n  createAlert() {\n    this.spxAlert.addAlert('Toast Message', 'success', this.callbackMethod);\n  }\n\n  callbackMethod() {\n    alert('Alert the callback');\n  }\n}\n```\n\n\n### Live updates locally\nWhen developing, make your changes and then run `npm run build`. Once this finishes just refresh and your changes should be seen locally.\n\n\n## Credits\n\nThis project is basically a stripped down version of\n[angular-async-local-storage](https://github.com/cyrilletuzi/angular-async-local-storage)\nby [https://github.com/cyrilletuzi](https://github.com/cyrilletuzi). In his blog he explains how to build a decent\nAngular module: [https://medium.com/@cyrilletuzi/how-to-build-and-publish-an-angular-module-7ad19c0b4464#.9y88ipdk7](https://medium.com/@cyrilletuzi/how-to-build-and-publish-an-angular-module-7ad19c0b4464#.9y88ipdk7)\n\n## License\n\nMIT\n","maintainers":[{"name":"jdesign_jason","email":"jdesigns.jason@gmail.com"}],"time":{"modified":"2022-06-12T14:08:22.126Z","created":"2017-12-31T20:01:31.526Z","0.0.1":"2017-12-31T20:01:31.526Z"},"homepage":"https://github.com/xjdesigns/angular-alert-service","keywords":["angular"],"repository":{"type":"git","url":"git+https://github.com/xjdesigns/angular-alert-service.git"},"contributors":[],"author":{"name":"Jason Jacobson"},"bugs":{"url":"https://github.com/xjdesigns/angular-alert-service/issues"},"license":"MIT","readmeFilename":"README.md"}