8000 Release 0.1.1 · cgeorg/sinject · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

0.1.1

Latest
Compare
Choose a tag to compare
@cgeorg cgeorg released this 07 Mar 22:41
· 5 commits to master since this release

0.1.1

Added convention based injection.

Now, instead of this:

var sinject = require('sinject');

var obj = {
    inject: function (obj2) {
      console.log('Hurray!');
    }
  };

sinject.register('obj', obj, obj.inject, 'obj2');

You can do this:

var sinject = require('sinject');

var obj = {
    $inject: ['obj2', function (obj2) {
      console.log('Hurray!');
    }]
  };

sinject.register('obj', obj);

If you preferred the old way, great! It still works.

0