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

Readme

Keywords

none

Package Sidebar

Install

npm i subsumer

Weekly Downloads

0

Version

0.5.0

License

MIT

Last publish

Collaborators

  • torjue