1234567891011121314151617181920 |
- import { getDependencyByIndex } from './decorators';
- function changeToSelf(target, index, withNew) {
- var descriptor = getDependencyByIndex(target, index);
- descriptor.withNew = withNew;
- }
- function withNewDecoratorFactoryProducer(withNew) {
- return function DecoratorFactory() {
- if (this instanceof DecoratorFactory) {
- return this;
- }
- return function (target, _key, index) {
- changeToSelf(target, index, withNew);
- };
- };
- }
- /**
- * Always initialize a new instance of that dependency instead of getting the cached instance from the injector.
- */
- export var WithNew = withNewDecoratorFactoryProducer(true);
- //# sourceMappingURL=dependencyWithNew.js.map
|