Angular Master (283 Qs)•Part 6: Decorators, Dependency Injection & Tooling (124 - 150)
What is NgUpgrade?
junior LevelMost AskedCode ExampleDependency InjectionTypeScript
NgUpgrade is a library put together by the Angular team, which you can use in your applications to mix and match AngularJS and Angular components and bridge the AngularJS and Angular dependency injection systems.
Practical Code Example
typescript
// NgUpgrade: Hybrid adapter library allowing AngularJS and Angular components to coexist:
import { UpgradeModule } from '@angular/upgrade/static';
export class AppModule {
constructor(private upgrade: UpgradeModule) {}
ngDoBootstrap() {
this.upgrade.bootstrap(document.body, ['legacyAngularJsApp']);
}
}