GitHub

  • get ( Service ) instanceof Service );
  • const { Inject , ReflectiveInjector } = require ( ‘ injection-js ‘ ); class Http {} class Service { static get parameters () { return [ new Inject (Http)]; } constructor ( http ) { this .
  • It is an extraction of the Angular’s dependency injection which means that it’s feature complete, fast, reliable and well tested.
  • require ( ‘ reflect-metadata ‘ ); var di = require ( ‘ injection-js ‘ ); var Http = di .
  • You can use, for instance, reflect-metadata , or core-js ( core-js/es7/reflect ) .

injection-js – Dependency injection library for JavaScript and TypeScript in 6.6K. It is an extraction of the Angular’s dependency injection which means that it’s feature complete, fast, reliable and well tested.

@JavaScriptDaily: injection-js: A Dependency Injection Library Extracted From Angular –

GitHub – mgechev/injection-js: Dependency injection library for JavaScript and TypeScript in 6.6K. It is an extraction of the Angular’s dependency injection which means that it’s feature complete, fast, reliable and well tested.

Dependency injection library for JavaScript and TypeScript in 6.6K. It is an extraction of the Angular’s dependency injection which means that it’s feature complete, fast, reliable and well tested.

demo docs: add information about reflect api Jan 26, 2017

spec/support ci: add travis Feb 2, 2017

tools chore: implement production build Jan 23, 2017

.travis.yml ci: add travis Feb 2, 2017

README.md ci: add travis Feb 2, 2017

package.json ci: add travis Feb 2, 2017

rollup.config.js chore: implement production build Jan 23, 2017

tsconfig.json chore: implement production build Jan 23, 2017

Dependency injection library for JavaScript and TypeScript in 6.6K. It is an extraction of the Angular’s dependency injection which means that it’s feature complete, fast, reliable and well tested.

const { Inject, ReflectiveInjector } = require(‘injection-js’); class Http {} class Service { static get parameters() { return [new Inject(Http)]; } constructor(http) { this.http = http; } } const injector = ReflectiveInjector.resolveAndCreate([Http, Service]); console.log(injector.get(Service) instanceof Service);

require(‘reflect-metadata’); var di = require(‘injection-js’); var Http = di.Class({ constructor : function () {} }); var Service = di.Class({ constructor: [Http, function (http) { this.http = http; }] }); var injector = di.ReflectiveInjector.resolveAndCreate([Http, Service]); console.log(injector.get(Service) instanceof Service);

For full documentation click here.

MIT

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

GitHub

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.