-1

One of my project requirement, I have to build the UI using Angular 7 on top of legacy codebase is AngularJS 1.x.

1) AngularJS is javascript but here Angular 7 is typescript.

How communication will happen through between these AngularJS and Angular.

Do we need to migrate legacy code to angular7 using Migration??

Please let me know the options to do that.

  • Possible duplicate question. This other question might help: https://stackoverflow.com/questions/37406678/how-to-use-angular-1-3-4-and-angular-2-together. But Personally I would suggest moving over to angular 2. Check the Angular website for help 'Upgrading from AngularJS to Angular'. But this depends on the size of the project – Jayme Nov 15 '19 at 08:05

1 Answers1

0

Please follow https://angular.io/guide/upgrade. You need to downgrade the Angular 7's components or services to be use in AngularJS.

Something like this downgrading service to be use in AngularJS:

@Injectable()
export class MyService {}

/// downgrade parts
import { downgradeInjectable } from '@angular/upgrade/static';
declare const angular: any;

angular.module('angularJSApp').factory('myservice', downgradeInjectable(MyService));
Jimmy Lin
  • 1,481
  • 6
  • 27
  • 44