| 123 | |
| 124 | // This Angular module represents the Angular pieces of the application. |
| 125 | @NgModule({ |
| 126 | imports: [BrowserModule], |
| 127 | declarations: [Ng2HeroesComponent, Ng1HeroComponentWrapper], |
| 128 | providers: [ |
| 129 | HeroesService, |
| 130 | // Register an Angular provider whose value is the "upgraded" AngularJS service. |
| 131 | {provide: 'titleCase', useFactory: (i: any) => i.get('titleCase'), deps: ['$injector']}, |
| 132 | ], |
| 133 | // Note that there are no `bootstrap` components, since the "downgraded" component |
| 134 | // will be instantiated by ngUpgrade. |
| 135 | }) |
| 136 | class MyLazyAngularModule { |
| 137 | // Empty placeholder method to prevent the `Compiler` from complaining. |
| 138 | ngDoBootstrap() {} |
| 139 | } |
| 140 | |
| 141 | // #docregion basic-how-to |
| 142 | |