{"id":21608260,"url":"https://github.com/mehrabisajad/ngx-source","last_synced_at":"2025-03-18T15:29:37.747Z","repository":{"id":38490376,"uuid":"282263312","full_name":"mehrabisajad/ngx-source","owner":"mehrabisajad","description":"angular source, can load js and css in runtime","archived":false,"fork":false,"pushed_at":"2023-11-22T08:19:32.000Z","size":377,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-23T12:13:28.282Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/mehrabisajad.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":"2020-07-24T16:06:53.000Z","updated_at":"2023-11-21T14:29:40.000Z","dependencies_parsed_at":"2024-11-24T20:37:11.240Z","dependency_job_id":"b8497461-f7c1-4f90-a05e-7f50dc5c9b84","html_url":"https://github.com/mehrabisajad/ngx-source","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrabisajad%2Fngx-source","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrabisajad%2Fngx-source/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrabisajad%2Fngx-source/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mehrabisajad%2Fngx-source/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mehrabisajad","download_url":"https://codeload.github.com/mehrabisajad/ngx-source/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244248930,"owners_count":20422870,"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":[],"created_at":"2024-11-24T20:37:01.956Z","updated_at":"2025-03-18T15:29:37.718Z","avatar_url":"https://github.com/mehrabisajad.png","language":"TypeScript","funding_links":[],"categories":["Third Party Components","Recently Updated"],"sub_categories":["Loaders","[Jul 26, 2025](/content/2025/07/26/README.md)"],"readme":"# ngx source\nangular source, can load js and css in runtime\n\n[![npm version](https://badge.fury.io/js/ngx-source.svg)](http://badge.fury.io/js/ngx-source)\n[![GitHub issues](https://img.shields.io/github/issues/mehrabisajad/ngx-source.svg)](https://github.com/mehrabisajad/ngx-source/issues)\n[![GitHub stars](https://img.shields.io/github/stars/mehrabisajad/ngx-source.svg)](https://github.com/mehrabisajad/ngx-source/stargazers)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/mehrabisajad/ngx-source/master/LICENSE)\n\n## Installation\n\nInstall through npm:\n```\nnpm install --save ngx-source\n```\n\nuse in one of your apps components:\n```typescript\nimport { Component, OnInit } from '@angular/core'; \nimport { Source, SourceType, NgxSourceService } from 'ngx-source';\n\n@Component({\n  template: 'your-component'\n})\nexport class YourComponent implements OnInit {\n\n    constructor(private ngxSourceService: NgxSourceService) {\n        this.ngxSourceService.addSources([\n            new Source('yourJsName', '/js/yourJsFile.js', SourceType.SCRIPT),\n            new Source('yourCssName', '/css/yourCssFile.js', SourceType.STYLE)\n        ]);\n    }\n    \n    async ngOnInit() {\n        await this.ngxSourceService.loadBySourceName('yourJsName');\n        await this.ngxSourceService.loadBySourceName('yourCssName');\n        \n        // or\n\n        await this.ngxSourceService.loadBySourceNames('yourJsName', 'yourCssName');\n    }   \n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehrabisajad%2Fngx-source","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmehrabisajad%2Fngx-source","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmehrabisajad%2Fngx-source/lists"}