Skip to content

ds82/ng.config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ng.config

problem

You almost always need a central config in your angular app. May it be for the root URL for your server API, the default language, the default theme or whatever parameter you may configure in your app.

solution

This module provides a super-simple $config service for your angular app.

usage

npm i --save ng.config
angular.module('app', ['ng.config'])
  .run(Setup);

Setup.$inject = ['$config'];
function Setup($config) {
  $config.SERVER_BASE = 'api/v1/';
}

All your services can than use this config:

angular.module('some.module', ['ng.config'])
  .service('SomeService', Service);

SomeService.$inject = ['$config', '$resource'];
function SomeService($config, $resource) {
  return $resource($config.SERVER_BASE + 'some',
  // ...
  );
}

About

ng.config

Resources

License

Stars

Watchers

Forks

Packages

No packages published