subsumer

0.5.0 • Public • Published

subsumer.js

var Subsumer = require("subsumer");

var ioc = new Subsumer();

var Person = function(weapon, singleton, name){
	this.name = name;
	this.weapon = weapon;
	this.singleton = singleton;
};

var Weapon = function(){
	this.name = "Sword";
};


var Singleton = function(){
	this.name = "Singleton";
};

ioc.bind("name").to("Normann");
ioc.bind("person").to(Person);
ioc.bind("weapon").to(Weapon);
ioc.bind("singleton").toSingleton(Singleton);

var person = ioc.resolve("person");
Add the following to survive minification:
var Person = function(weapon, singleton, name){
	this.name = name;
	this.weapon = weapon;
	this.singleton = singleton;
};
Person.$inject = ['weapon', 'singleton', 'name'];

License

MIT: torjue.mit-license.org

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.5.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.5.0
    2

Package Sidebar

Install

npm i subsumer

Weekly Downloads

2

Version

0.5.0

License

MIT

Last publish

Collaborators

  • torjue