{"id":19438872,"url":"https://github.com/danwild/angular2-heroes","last_synced_at":"2026-05-17T07:41:21.484Z","repository":{"id":78506358,"uuid":"49682240","full_name":"danwild/angular2-heroes","owner":"danwild","description":"Angular2 BETA tutorial and notes","archived":false,"fork":false,"pushed_at":"2016-01-15T01:30:33.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-25T07:17:51.405Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://angular.io/docs/ts/latest/tutorial/","language":"JavaScript","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/danwild.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}},"created_at":"2016-01-14T23:31:28.000Z","updated_at":"2016-01-14T23:34:39.000Z","dependencies_parsed_at":"2023-03-18T03:01:15.645Z","dependency_job_id":null,"html_url":"https://github.com/danwild/angular2-heroes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danwild/angular2-heroes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danwild%2Fangular2-heroes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danwild%2Fangular2-heroes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danwild%2Fangular2-heroes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danwild%2Fangular2-heroes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danwild","download_url":"https://codeload.github.com/danwild/angular2-heroes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danwild%2Fangular2-heroes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33131218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T06:27:06.342Z","status":"ssl_error","status_checked_at":"2026-05-17T06:26:59.432Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-11-10T15:20:03.700Z","updated_at":"2026-05-17T07:41:21.456Z","avatar_url":"https://github.com/danwild.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Notes/Takeaways\n\n\u003cul\u003e\n\t\u003cli\u003e\u003cstrong\u003eNaming conventions:\u003c/strong\u003e filename is the name of the module (lower-case-dashed), and the module type is denoted in a postfix, e.g.\n\t    \u003cul\u003e\n\t        \u003cli\u003e\n\t            Class component postfixed with \u003ccode\u003e.component\u003c/code\u003e, \n                e.g. \u003ccode\u003eapp.component\u003c/code\u003e (.ts) should export \u003ccode\u003eAppComponent\u003c/code\u003e.\n            \u003c/li\u003e\n\t        \u003cli\u003e\n\t            Services postfixed with \u003ccode\u003e.service\u003c/code\u003e\n\t            e.g. \u003ccode\u003ehero.service\u003c/code\u003e (.ts) should export \u003ccode\u003eHeroService\u003c/code\u003e.     \n            \u003c/li\u003e\n\t    \u003c/ul\u003e\n    \u003c/li\u003e\n\t\u003cli\u003e\u003ccode\u003e@Component\u003c/code\u003e used to define metadata for an Angular component\u003c/li\u003e\n\t\u003cli\u003eCLASSES when we need logic and behavior\u003c/li\u003e\n\t\u003cli\u003eINTERFACES when we just want type checking (also lighter weight, as nothing needs to be transpiled for interface)\u003c/li\u003e\n\t\u003cli\u003eCan use backticks \u003ccode\u003e`\u003c/code\u003e for multi-line template strings\u003c/li\u003e\n\t\u003cli\u003eComponent styles scoped to that specific component only (+1 for modularity)\u003c/li\u003e\n\t\u003cli\u003e\u003ccode\u003e@Injectable()\u003c/code\u003e decorator used to enable DI for a service etc., best practice to add it from the start (consistency, future-proofing)\u003c/li\u003e\n\t\u003cli\u003eTo get an injectable service, we must add it to \u003ccode\u003eproviders\u003c/code\u003e array in \u003ccode\u003e@Component\u003c/code\u003e metadata.\u003cbr/\u003e\n\t\u003cstrong\u003eNote:\u003c/strong\u003e components inherit the services of the other component above them in the component tree, so you need to think about where\n\t in the tree you define a service \u003ccode\u003eprovider\u003c/code\u003e (only one per instance of app).\n\t\u003c/li\u003e\n\t\u003cli\u003e\n\t\tInjectable go into \u003ccode\u003econstructor\u003c/code\u003e\n\t\u003c/li\u003e\n\t\u003cli\u003ePrivate vars (e.g. an injected service) should be prefixed with \u003ccode\u003e_\u003c/code\u003e underscore to warn that it's not part of components public API\u003c/li\u003e\n\t\u003cli\u003eTo avoid heavy lifting in constructor (web service/config loading), we have Angular's \u003ccode\u003engOnInit\u003c/code\u003e Lifecycle Hook\u003c/li\u003e\n\u003c/ul\u003e\t\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanwild%2Fangular2-heroes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanwild%2Fangular2-heroes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanwild%2Fangular2-heroes/lists"}