Class Overview
class PlatformRef {
bootstrapModuleFactory
(moduleFactory: NgModuleFactory<M>) : Promise<NgModuleRef<M>>
bootstrapModule
(moduleType: Type<M>, compilerOptions?: CompilerOptions|CompilerOptions[]) : Promise<NgModuleRef<M>>
onDestroy
(callback: () => void) : void
injector
: Injector
destroy
() : void
destroyed
: boolean
}
Class Description
The Angular platform is the entry point for Angular on a web page. Each page has exactly one platform, and services (such as reflection) which are common to every Angular application running on the page are bound in its scope.
A page's platform is initialized implicitly when bootstrap() is called, or
explicitly by calling createPlatform
().
Class Details
bootstrapModuleFactory(moduleFactory: NgModuleFactory<M>) : Promise<NgModuleRef<M>>
Creates an instance of an @NgModule
for the given platform
for offline compilation.
Simple Example
bootstrapModule(moduleType: Type<M>, compilerOptions?: CompilerOptions|CompilerOptions[]) : Promise<NgModuleRef<M>>
Creates an instance of an @NgModule
for a given platform using the given runtime compiler.
Simple Example
onDestroy(callback: () => void) : void
Register a listener to be called when the platform is disposed.
injector : Injector
Retrieve the platform Injector
, which is the parent injector for
every Angular application on the page and provides singleton providers.
destroy() : void
Destroy the Angular platform and all Angular applications on the page.
destroyed : boolean
exported from core/index, defined in core/src/application_ref.ts