Skip to content Skip to sidebar Skip to footer

Using Angular 2 Components In Angular 1 App Without Upgrade Plugin

Currently we have old project developed using lineman-angular-templat, angular 1.5 and ES5 We need to add new features and i want to add them as angular 2 components. We have not t

Solution 1:

The angular docs write:

One of the keys to a successful upgrade is to do it incrementally, by running the two frameworks side by side in the same application, and porting Angular 1 components to Angular 2 one by one. This makes it possible to upgrade even large and complex applications without disrupting other business, because the work can be done collaboratively and spread over a period of time. The upgrade module in Angular 2 has been designed to make incremental upgrading seamless.

and

When we use UpgradeAdapter, what we're really doing is running both versions of Angular at the same time. All Angular 2 code is running in the Angular 2 framework, and Angular 1 code in the Angular 1 framework. Both of these are the actual, fully featured versions of the frameworks. There is no emulation going on, so we can expect to have all the features and natural behavior of both frameworks.

What happens on top of this is that components and services managed by one framework can interoperate with those from the other framework. This happens in three main areas: Dependency injection, the DOM, and change detection.

That is, the upgrade module does exactly what you want.

Post a Comment for "Using Angular 2 Components In Angular 1 App Without Upgrade Plugin"