injection-js
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -796,3 +796,3 @@ (function (global, factory) { | ||
*/ | ||
var DELEGATE_CTOR = /^function\s+\S+\(\)\s*{\s*("use strict";)?\s*(return\s+)?\S+\.apply\(this,\s*arguments\)/; | ||
var DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*arguments\)/; | ||
var ReflectionCapabilities = (function () { | ||
@@ -799,0 +799,0 @@ function ReflectionCapabilities(reflect) { |
{ | ||
"name": "injection-js", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Dependency Injection library for JavaScript and TypeScript", | ||
@@ -5,0 +5,0 @@ "main": "injection.bundle.js", |
@@ -21,3 +21,3 @@ [![Build Status](https://travis-ci.org/mgechev/injection-js.svg?branch=master)](https://travis-ci.org/mgechev/injection-js) | ||
import 'reflect-metadata'; | ||
import { ReflectiveInjector, Injectable } from 'injection-js'; | ||
import { ReflectiveInjector, Injectable, Injector } from 'injection-js'; | ||
@@ -31,2 +31,17 @@ class Http {} | ||
@Injectable() | ||
class Service2 { | ||
constructor(private injector: Injector) {} | ||
getService(): void { | ||
console.log(this.injector.get(Service) instanceof Service); | ||
} | ||
createChildInjector(): void { | ||
const childInjector = ReflectiveInjector.resolveAndCreate([ | ||
Service | ||
], this.injector); | ||
} | ||
} | ||
const injector = ReflectiveInjector.resolveAndCreate([ | ||
@@ -33,0 +48,0 @@ Service, |
@@ -13,3 +13,3 @@ /** | ||
*/ | ||
export var DELEGATE_CTOR = /^function\s+\S+\(\)\s*{\s*("use strict";)?\s*(return\s+)?\S+\.apply\(this,\s*arguments\)/; | ||
export var DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*arguments\)/; | ||
export var ReflectionCapabilities = (function () { | ||
@@ -16,0 +16,0 @@ function ReflectionCapabilities(reflect) { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
216617
102