2

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 time and money for creating new application with Angular 2.

The goad is to use angular 1 and ui-routing for navigation to new pages and insert into new pages angular 2 components.

Is it possible to do it without using upgrade plugin and downgrading angular 2 components to angular 1 directives?

Is it possible to have angular 1 and augular 2 components running together?

I really want to use benefits of angular 2 change detection mechanism etc

2
  • Why don't you want to use the upgrade plugin? Commented Jul 31, 2016 at 20:30
  • So update plugin, as far as i understand, downgrades angular 2 components into angular 1 directives and adds them to angular 1 application. But i want to have two applications. Angular 1 should render it's own components and so should do Angular 2 Commented Aug 1, 2016 at 7:06

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.