{"id":21919759,"url":"https://github.com/gilf/ngconfig","last_synced_at":"2026-04-13T09:32:01.653Z","repository":{"id":146083552,"uuid":"48878585","full_name":"gilf/ngConfig","owner":"gilf","description":"A simple configuration service for AngularJS 1 apps","archived":false,"fork":false,"pushed_at":"2016-01-05T17:52:08.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-04T04:49:43.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/gilf.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-01-01T13:20:54.000Z","updated_at":"2016-07-06T14:00:24.000Z","dependencies_parsed_at":"2023-04-17T17:42:38.578Z","dependency_job_id":null,"html_url":"https://github.com/gilf/ngConfig","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gilf/ngConfig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilf%2FngConfig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilf%2FngConfig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilf%2FngConfig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilf%2FngConfig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gilf","download_url":"https://codeload.github.com/gilf/ngConfig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilf%2FngConfig/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746294,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2024-11-28T20:10:36.545Z","updated_at":"2026-04-13T09:32:01.637Z","avatar_url":"https://github.com/gilf.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"ngConfig\n==============\n\nA simple configuration service for AngularJS 1 apps.\n\nCopyright (C) 2015, Gil Fink \u003cgil@sparxys.com\u003e\n\nInstallation\n------------\n\nYou can choose your preferred method of installation:\n* Download from github: [ngConfig.min.js](https://github.com/gilf/ngConfig/blob/master/ngConfig.min.js)\n\nUsage\n-----\nInclude **ngConfig.js** in your application.\n\n```html\n\u003cscript src=\"components/ngConfig/ngConfig.js\"\u003e\u003c/script\u003e\n```\n\nAdd the module `ngConfig` as a dependency to your app module:\n\n```js\nvar myapp = angular.module('myapp', ['ngConfig']);\n```\n\n### configuration service\nUse the APIs that the configuration service exposes to use your application configuration.\nIn the API you have four functions:\n* init(): initializes the configuration service.\n  If you are loading the configuration from file, by default the configuration service will look a file called config.json which exists in a config folder -'config/config.json'.\n  Usage example:\n\n  ```js\n  config.init().then(function() {\n\n  });\n  ```\n\n* isInitialized(): checks whether the configuration object was loaded into memory.\n  Usage example:\n\n  ```js\n  if (!config.isInitialized()) {\n    config.init().then(function() {\n\n    });\n  }\n  ```\n\n* getConfigByKey(key): retrieve a configuration according to the supplied key.\n  ```js\n  var val = config.getConfigByKey('key');\n  ```\n\n* setConfigOfKey(key, value): sets the configuration of the supplied key to new configuration.\n  When you set the key in a scenario of loading the configurations from file, only the in-memory object is updated (the value isn't saved to the configuration file).\n  ```js\n  config.setConfigOfKey('key', 'value');\n  ```\n\nYou can configure the configuration file Uri by using the **setConfigUri** function when you configure your module.\n  ```js\n  var app = angular.module('app', ['ngConfig']);\n  app.config(['configProvider', function (configProvider) {\n    configProvider.setConfigUri('config/yourFileName.json');\n  }]);\n  ```\nYou can use localStorage to hold your configurations. Use **useLocalStorageForConfig** with an application prefix string to use localStorage.\n  ```js\n  var app = angular.module('app', ['ngConfig']);\n  app.config(['configProvider', function (configProvider) {\n    configProvider.useLocalStorageForConfig('myAppName');\n  }]);\n  ```\n\nAn example of a configuration file:\n```js\n{\n  \"config1\": 15,\n  \"config2\": false,\n  \"config3\": \"config3\",\n  \"config4\": [],\n  \"config5\": {}\n}\n```\n\nAs shown in the Following Post:\n-----\nhttp://blogs.microsoft.co.il/gilf/2015/06/22/building-a-simple-angularjs-configuration-service/\n\nLicense\n----\n\nReleased under the terms of the [MIT License](LICENSE).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilf%2Fngconfig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgilf%2Fngconfig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilf%2Fngconfig/lists"}