1
|
/**
|
2
|
* @license
|
3
|
* Copyright Google Inc. All Rights Reserved.
|
4
|
*
|
5
|
* Use of this source code is governed by an MIT-style license that can be
|
6
|
* found in the LICENSE file at https://angular.io/license
|
7
|
*/
|
8
|
import { Injector } from '../di/injector';
|
9
|
import { Type } from '../type';
|
10
|
import { ComponentFactoryResolver } from './component_factory_resolver';
|
11
|
/**
|
12
|
* Represents an instance of an NgModule created via a {@link NgModuleFactory}.
|
13
|
*
|
14
|
* `NgModuleRef` provides access to the NgModule Instance as well other objects related to this
|
15
|
* NgModule Instance.
|
16
|
*
|
17
|
* @stable
|
18
|
*/
|
19
|
export declare abstract class NgModuleRef<T> {
|
20
|
/**
|
21
|
* The injector that contains all of the providers of the NgModule.
|
22
|
*/
|
23
|
readonly abstract injector: Injector;
|
24
|
/**
|
25
|
* The ComponentFactoryResolver to get hold of the ComponentFactories
|
26
|
* declared in the `entryComponents` property of the module.
|
27
|
*/
|
28
|
readonly abstract componentFactoryResolver: ComponentFactoryResolver;
|
29
|
/**
|
30
|
* The NgModule instance.
|
31
|
*/
|
32
|
readonly abstract instance: T;
|
33
|
/**
|
34
|
* Destroys the module instance and all of the data structures associated with it.
|
35
|
*/
|
36
|
abstract destroy(): void;
|
37
|
/**
|
38
|
* Allows to register a callback that will be called when the module is destroyed.
|
39
|
*/
|
40
|
abstract onDestroy(callback: () => void): void;
|
41
|
}
|
42
|
export interface InternalNgModuleRef<T> extends NgModuleRef<T> {
|
43
|
_bootstrapComponents: Type<any>[];
|
44
|
}
|
45
|
/**
|
46
|
* @experimental
|
47
|
*/
|
48
|
export declare abstract class NgModuleFactory<T> {
|
49
|
readonly abstract moduleType: Type<T>;
|
50
|
abstract create(parentInjector: Injector | null): NgModuleRef<T>;
|
51
|
}
|