parent
67ad59c245
commit
7d006c5005
|
@ -38,18 +38,14 @@ import {defineInjectable} from './defs';
|
||||||
*
|
*
|
||||||
* @usageNotes
|
* @usageNotes
|
||||||
* ### Basic Example
|
* ### Basic Example
|
||||||
|
|
||||||
* #### Tree-shakable InjectionToken
|
|
||||||
*
|
|
||||||
* {@example core/di/ts/injector_spec.ts region='ShakeableInjectionToken'}
|
|
||||||
*
|
*
|
||||||
* #### Plain InjectionToken
|
* #### Plain InjectionToken
|
||||||
*
|
*
|
||||||
* {@example core/di/ts/injector_spec.ts region='InjectionToken'}
|
* {@example core/di/ts/injector_spec.ts region='InjectionToken'}
|
||||||
*
|
*
|
||||||
* ### Tree-shakeable Example
|
* #### Tree-shakable InjectionToken
|
||||||
*
|
*
|
||||||
* {@example core/di/ts/injector_spec.ts region='ShakeableInjectionToken'}
|
* {@example core/di/ts/injector_spec.ts region='ShakableInjectionToken'}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
export class InjectionToken<T> {
|
export class InjectionToken<T> {
|
||||||
|
|
|
@ -61,7 +61,7 @@ class MockRootScopeInjector implements Injector {
|
||||||
const injector =
|
const injector =
|
||||||
new MockRootScopeInjector(Injector.create({providers: [{provide: MyDep, deps: []}]}));
|
new MockRootScopeInjector(Injector.create({providers: [{provide: MyDep, deps: []}]}));
|
||||||
|
|
||||||
// #docregion ShakeableInjectionToken
|
// #docregion ShakableInjectionToken
|
||||||
class MyService {
|
class MyService {
|
||||||
constructor(readonly myDep: MyDep) {}
|
constructor(readonly myDep: MyDep) {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue