Skip to content

torjue/subsumer.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Lightweight IoC for JavaScript applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published