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

Releases: cgeorg/sinject

0.1.1

07 Mar 22:41
Compare
Choose a tag to compare
53D7

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