Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@angular/upgrade
Advanced tools
@angular/upgrade is a library that facilitates the migration of AngularJS applications to Angular by allowing both frameworks to coexist and interoperate within the same application. It provides tools to bootstrap hybrid applications, upgrade AngularJS components to Angular, and downgrade Angular components to AngularJS.
Hybrid Application Bootstrapping
This feature allows you to bootstrap a hybrid application that runs both Angular and AngularJS code. The code sample demonstrates how to bootstrap an Angular module and then use the UpgradeModule to bootstrap an AngularJS application within the same document.
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { UpgradeModule } from '@angular/upgrade/static';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => {
const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule;
upgrade.bootstrap(document.body, ['angularjsApp']);
});
Upgrading AngularJS Components
This feature allows you to upgrade AngularJS components to be used in Angular. The code sample shows how to create an Angular component that wraps an AngularJS component using the UpgradeComponent class.
import { UpgradeComponent } from '@angular/upgrade/static';
@Component({
selector: 'app-hero-detail',
template: '<hero-detail></hero-detail>'
})
export class HeroDetailComponent extends UpgradeComponent {
constructor(elementRef: ElementRef, injector: Injector) {
super('heroDetail', elementRef, injector);
}
}
Downgrading Angular Components
This feature allows you to downgrade Angular components so they can be used in AngularJS applications. The code sample demonstrates how to create an AngularJS directive that wraps an Angular component using the downgradeComponent function.
import { downgradeComponent } from '@angular/upgrade/static';
import { HeroDetailComponent } from './hero-detail.component';
angular.module('angularjsApp').directive('heroDetail', downgradeComponent({
component: HeroDetailComponent
}));
ng-metadata is a library that provides a set of decorators and utilities to write AngularJS applications using Angular-style TypeScript syntax. It helps in gradually migrating AngularJS code to Angular by allowing developers to use Angular concepts in AngularJS. Unlike @angular/upgrade, which focuses on running both frameworks together, ng-metadata focuses on improving AngularJS code with Angular patterns.
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT
19.2.0-next.0 (2025-01-22)
| Commit | Type | Description | | -- | -- | -- | | fe8a68329b | feat | support untagged template literals in expressions (#59230) |
| Commit | Type | Description | | -- | -- | -- | | ed705a856a | feat | detect missing structural directive imports (#59443) |
| Commit | Type | Description | | -- | -- | -- | | bc2ad7bfd3 | feat | support streaming resources (#59573) |
<!-- CHANGELOG SPLIT MARKER --><a name="19.1.3"></a>
FAQs
Angular - the library for easing update from v1 to v2
The npm package @angular/upgrade receives a total of 18,396 weekly downloads. As such, @angular/upgrade popularity was classified as popular.
We found that @angular/upgrade demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.