{"id":21716623,"url":"https://github.com/mohammadmusaei/a4","last_synced_at":"2026-05-15T18:34:27.113Z","repository":{"id":97524007,"uuid":"102474201","full_name":"mohammadmusaei/A4","owner":"mohammadmusaei","description":"Design Pattern for angular 4 applications","archived":false,"fork":false,"pushed_at":"2017-10-24T10:43:25.000Z","size":83,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T19:18:39.310Z","etag":null,"topics":["angular","angular2","angular4","angularjs","design-patterns","designpattern","typscript"],"latest_commit_sha":null,"homepage":"https://mohammadmusaei.github.io/A4/","language":"TypeScript","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/mohammadmusaei.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-05T11:42:44.000Z","updated_at":"2019-12-05T10:15:49.000Z","dependencies_parsed_at":"2023-05-09T16:52:29.977Z","dependency_job_id":null,"html_url":"https://github.com/mohammadmusaei/A4","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mohammadmusaei/A4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmusaei%2FA4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmusaei%2FA4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmusaei%2FA4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmusaei%2FA4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohammadmusaei","download_url":"https://codeload.github.com/mohammadmusaei/A4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohammadmusaei%2FA4/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33074869,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["angular","angular2","angular4","angularjs","design-patterns","designpattern","typscript"],"created_at":"2024-11-26T01:12:25.245Z","updated_at":"2026-05-15T18:34:27.089Z","avatar_url":"https://github.com/mohammadmusaei.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Angular 4 Design Pattern\n\n**A4** is a design pattern for large scale angular 4 applications that is easy to use and implement.\n\n## Code Seperation\n\n**A4** categorize app basics like (services, directives,etc) to seperate parts. components and directives have seperate modules to import in project.\n\n```typescript\nimports: [\n    BrowserModule,\n    FormsModule,\n    ReactiveFormsModule,\n    AppRoutingModule,\n    FrameworkDirectiveModule,\n    FrameworkComponentModule\n]\n```\n\n## Components\n\nA4 have a `BaseComponent` that provide common services for other components, `BaseComponent` have two Generic types, First one is component model and second is component service for CRUD and other database interactions.For dynamic injection `BaseComponent` use `Injector` and `ReflectiveInjector` for resolve and create providers and services.When a component extends `BaseComponent` by inheritance component have two property: a model and service.\n\n```typescript\nexport class SampleComponent extends BaseComponent\u003cUser,UserService\u003e implements OnInit {\n\n  constructor(injector : Injector){\n    super(injector);\n  }\n  onSubmit() : void{\n    this.service.post(this.model);\n  }\n\n  ngOnInit() {\n  }\n\n}\n```\n\n## Services\n\n###### HtppService\nA4 have a `HttpService` that use Angular native http provider for database interactions.\n\n###### JsonpService\nA4 have a `JsonpService` that use Angular native http provider for database interactions.\n\n###### BaseDataService\nA4 have a `BaseDataService` that provide common CRUD actions like: (POST,GET,GETALL,...), `BaseDataService` have one Generic type that is the service model.`BaseDataService` use `HttpService` for CRUD.\n\nfor example when an app service extends `BaseDataService` then it have all common methods already and could have more specific methods.\n\n```typescript\n@Injectable()\nexport class UserService extends BaseDataService\u003cUser\u003e{\n\n  constructor(injector : Injector) {\n    super(injector);\n  }\n  \n  public login(user : User) : Obervable\u003cT\u003e {\n    return this.http.post(user);\n  }\n\n}\n```\n\n## Validation\n\n###### :clock130: Comming soon... \n\n\n_______________________________________________________________________________________________________\n\nThis project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.3.2.\n\n###### Development server\n\nRun `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.\n\n###### Code scaffolding\n\nRun `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.\n\n###### Build\n\nRun `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.\n\n###### Running unit tests\n\nRun `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).\n\n###### Running end-to-end tests\n\nRun `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).\nBefore running the tests make sure you are serving the app via `ng serve`.\n\n###### Further help\n\nTo get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadmusaei%2Fa4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohammadmusaei%2Fa4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadmusaei%2Fa4/lists"}