{"id":24525904,"url":"https://github.com/joeherold/angular2-sails","last_synced_at":"2025-09-05T06:38:59.767Z","repository":{"id":57179774,"uuid":"61804795","full_name":"joeherold/angular2-sails","owner":"joeherold","description":"An angular module for using the sails socket.io api in angular2 (@angular)","archived":false,"fork":false,"pushed_at":"2018-09-25T13:43:27.000Z","size":113,"stargazers_count":36,"open_issues_count":1,"forks_count":15,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-14T14:30:09.318Z","etag":null,"topics":["angular","sails","sailsjs","socket-io"],"latest_commit_sha":null,"homepage":null,"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/joeherold.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-23T12:50:48.000Z","updated_at":"2023-08-31T17:24:42.000Z","dependencies_parsed_at":"2022-09-14T03:30:50.078Z","dependency_job_id":null,"html_url":"https://github.com/joeherold/angular2-sails","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/joeherold/angular2-sails","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeherold%2Fangular2-sails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeherold%2Fangular2-sails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeherold%2Fangular2-sails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeherold%2Fangular2-sails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeherold","download_url":"https://codeload.github.com/joeherold/angular2-sails/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeherold%2Fangular2-sails/sbom","scorecard":{"id":526655,"data":{"date":"2025-08-11","repo":{"name":"github.com/joeherold/angular2-sails","commit":"ed42edb3c5fefd278dd6816a5b10f382878f7ee1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 1/29 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T04:34:35.683Z","repository_id":57179774,"created_at":"2025-08-20T04:34:35.683Z","updated_at":"2025-08-20T04:34:35.683Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273723193,"owners_count":25156302,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","sails","sailsjs","socket-io"],"created_at":"2025-01-22T05:29:13.231Z","updated_at":"2025-09-05T06:38:59.738Z","avatar_url":"https://github.com/joeherold.png","language":"TypeScript","readme":"# important\nThis repo is no longer maintained! We switched to [React JS](https://reactjs.org/) completely. Feel free to fork this repo.\n\n\n# angular2-sails\nAn angular module for using the sails socket.io api in angular2 (@angular)\n\nRead the full documentation at: [Documentation @ gitbook.com](https://joeherold.gitbooks.io/angular2-sails/content/ \"Documentation @ gitbook.com\")\n\n## INDEX\n\n* [Usage with angular-cli](#usage-with-angular-cli)\n* [Installing](#1-installing)\n* [Using it](#2-using-it)\n* [Working with it](#working-with-it)\n* [Example](#example)\n* [Example with async pipe](#example-with-async-pipe)\n* [Important notes to io.js (sails.io.js)](#important-notes)\n\n## Usage with angular-cli\nAngular-cli is a great angular2 app starter for creating fancy angular stuff.\n\nHere I will describe on how to install and use it:\n\n### 1. Installing\n\ninstall the package with the node package manager (npm)\n\n```npm install --save angular2-sails```\n\n\n[back to top](#index)\n\n### 2. Using it\n\nin app.module.ts import and register the angular2-sails module like that:\n\n```typescript\n...\nimport { AppComponent } from './app.component';\nimport {SailsModule} from \"angular2-sails\";\n\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [\n    ...,\n    SailsModule.forRoot()\n  ],\n\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n\n```\n\n[back to top](#index)\n\n### working with it\n\nYou inject the service by the constructor where you want to use it.\n\n```typescript\nconstructor(private _sailsService:SailsService) { }\n```\n\nfirst you have to connect your service:\n\n```typescript\nngOnInit() {\n    this._sailsService.connect()\n}\n```\n\nyou can pass in an Url or Options, where to connect to\n```typescript\nngOnInit() {\n    this._sailsService.connect(\"http://localhost:1337\");\n    // or\n    letl opts = {\n        url: \"http://localhost:1337\",\n        transports: ['polling', 'websocket'],\n        headers: {...},\n        ...\n    }\n    this._sailsService.connect(opts);\n}\n```\nfor more information, please visit [sailsjs.org Documentation for SailsSocket Properties](http://sailsjs.org/documentation/reference/web-sockets/socket-client/sails-socket/properties)\n\nthis is handy, when you develop with angular-cli (localhost:4200) and the ng serve command\nand your sails app runs separately e.g on localhost:1337\n\n\n\n\nThe following methods are implemented in the SailsService and will always return you an Observable\u003cT\u003e:\n\n- get(path,data):Observable\n- post(path,data):Observable\n- put(path,data):Observable\n- patch(path,data):Observable\n- delete(path,data):Observable\n- request(options):Observable\n- on(eventEntity):Observable\n\nfor more information, please visit [sailsjs.org Documentation for SailsSocket Methods](http://sailsjs.org/documentation/reference/web-sockets/socket-client/sails-socket/methods)\n\nYou then have to subscribe to that Observable, to get the data.\n\n[back to top](#index)\n\n\n\n# IMPORTANT NOTES\n## io (sails.io.js)\nI was asked couple of times, why one gets an error like (io is not defined).\nSo to clear things up a bit. The io library (sails.io.js) is not part of this module. So that's why you have to add io (sail.io.js) yourself to your project. Otherwise io will not be defined as a global varable and will not be accessible.\n\nThere are several ways to do so:\n\n### by script tag\nOne is to link the sail.io.js in your index.html or layout.ejs as a simple script tag.\n\n```html\n\u003c!doctype html\u003e\n\u003chtml\u003e\n\u003chead\u003e\n  \u003cmeta charset=\"utf-8\"\u003e\n  \u003ctitle\u003eSailsapp\u003c/title\u003e\n  \u003cbase href=\"/\"\u003e\n\n  \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u003e\n  \u003clink rel=\"icon\" type=\"image/x-icon\" href=\"favicon.ico\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003capp-root\u003eLoading...\u003c/app-root\u003e\n\n  \u003c!-- add the io library --\u003e\n  \u003cscript src=\"/assets/sails.io/sails.io.js\"\u003e\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n\n### angular-cli (webpack version)\nWhen you are using angular-cli (what is my recommendation), then you can add the file to the scripts array of your angular-cli.json.\n\n```javascript\n// ANGULAR_CLI_ROOT/angular-cli.json\n{\n  \"project\": {\n    ...\n  },\n  \"apps\": [\n    {\n      ...\n      \"styles\": [\n        \"styles.less\"\n      ],\n      \"scripts\": [\n      \t\"../path/to/sails.io.js\" //this is where you may add the io library\n      ],\n      ...\n    }\n  ],\n  ...\n}\n```\n\n### plain webpack\nWhen you are using webpack, you also could add the sails.io.js file to your project by installing the library and requireing it.\n\n[back to top](#index)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeherold%2Fangular2-sails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeherold%2Fangular2-sails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeherold%2Fangular2-sails/lists"}