Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AngularPlatform

Provides support for using Alterior modules within a larger Angular host application.

Important: import "reflect-metadata";

Make sure you import "reflect-metadata"; at the top of your Angular application's entrypoint (usually "main.ts"). If you fail to do so, the necessary metadata for some of your Alterior modules may not properly load. It is also important to ensure that your overall application has only one version of "reflect-metadata". Use npm ls reflect-metadata and ensure that only one version is present and all are deduped.

Enable "emitDecoratorMetadata" if you use Alterior in the app project

Note: If you define Alterior modules and services within your Angular application, you will also need to ensure "emitDecoratorMetadata": true is present in the compilerOptions of your tsconfig.json. Failure to do so will cause Alterior to be unable to properly resolve the dependency injections within your classes defined in the application project.

Hierarchy

  • AngularPlatform

Index

Methods

Methods

Static bootstrap

  • bootstrap(entryModule: any): AngularProvider[]
  • Bootstraps an Alterior application module and returns a set of Angular compatible dependency injection providers. You should then pass those providers to the providers declaration of an @NgModule or @Component class.

    Parameters

    • entryModule: any

    Returns AngularProvider[]

Static bridge

  • bridge(...imports: any[]): (any[] | TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider)[]
  • Creates a new dynamic Alterior application module which imports the given modules and returns a set of Angular-compatible dependency injection providers. You should pass the result into the providers property of an @NgModule or @Component to make the services provided by Alterior available within the scope you are declaring.

    Parameters

    • Rest ...imports: any[]

      The set of Alterior modules you wish to bootstrap

    Returns (any[] | TypeProvider | ValueProvider | ClassProvider | ConstructorProvider | ExistingProvider | FactoryProvider)[]

Generated using TypeDoc