2018-02-16 11:45:21 -05:00
|
|
|
/**
|
|
|
|
* @license
|
|
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
* found in the LICENSE file at https://angular.io/license
|
|
|
|
*/
|
|
|
|
|
2019-04-04 14:41:52 -04:00
|
|
|
import {Injector, ɵcreateInjector as createInjector, ΔdefineInjectable, ΔdefineInjector} from '@angular/core';
|
2018-02-16 11:45:21 -05:00
|
|
|
|
|
|
|
export class RootService {
|
2019-04-04 14:41:52 -04:00
|
|
|
static ngInjectableDef = ΔdefineInjectable({
|
2018-02-16 11:45:21 -05:00
|
|
|
providedIn: 'root',
|
|
|
|
factory: () => new RootService(),
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export class ScopedService {
|
2019-04-04 14:41:52 -04:00
|
|
|
static ngInjectableDef = ΔdefineInjectable({
|
2018-02-16 11:45:21 -05:00
|
|
|
providedIn: null,
|
|
|
|
factory: () => new ScopedService(),
|
|
|
|
});
|
|
|
|
|
|
|
|
doSomething(): void {
|
|
|
|
// tslint:disable-next-line:no-console
|
|
|
|
console.log('Ensure this isn\'t tree-shaken.');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class DefinedInjector {
|
2019-04-04 14:41:52 -04:00
|
|
|
static ngInjectorDef = ΔdefineInjector({
|
2018-02-16 11:45:21 -05:00
|
|
|
factory: () => new DefinedInjector(),
|
|
|
|
providers: [ScopedService],
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export const INJECTOR = createInjector(DefinedInjector);
|