Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 849 Bytes

bootstrap.md

File metadata and controls

27 lines (20 loc) · 849 Bytes

Bootstrapping ng-metadata

ng-metadata provides @NgModule from Angular to AngularJS. To use @NgModule, update your application bootstrap from angular.bootstrap to the example below.

Bootstrap (bootstrap.ts)

import { platformBrowserDynamic } from "ng-metadata/platform-browser-dynamic";
import { AppModule } from "./app.module";

platformBrowserDynamic().bootstrapModule(AppModule);

App Module (app.module.ts)

import { NgModule } from "ng-metadata/core";
import { AppComponent } from "./app.component";
import { HeroComponent } from "./hero.component";
import { HeroService } from "./hero.service";

@NgModule({
  declarations: [AppComponent, HeroComponent],
  providers: [HeroService],
})
export class AppModule {}