Expand my Community achievements bar.

SOLVED

About AEM 6.5 integration with angular 2 ( version 12)

Avatar

Level 8

Hi,

 

Could you please provide inputs as what will be the best practice of migrating the existing AEM code from Angular js to AEM code to angular 2 ( version 12).

 

Any sample codes will be useful.

Had a question , is it good practice  to move the current AEM component.html to angular 2 app based *.html file move all the logic there

 

In that way we need to have in AEM component.html  just  pojo methods  to send the whole object to angular 2 code.

 

Thanks

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

There are many ways to do this, but here's what I would do.

Pre-requirement is for you to actually be familiar with AngularJS vs Angular. And understanding how to migrate AngularJS components to Angular. I searched on youtube "migrate AngularJS components to Angular", (1) JavaScript Marathon: Upgrade AngularJS to Angular with Angular Elements - YouTube

 

I'll give you the most simplest high level approach.

 

start a new angular project, migrate the code from AngularJS to Angular inside of it, use a dev server during the migration to make sure everything is working as expected, and finally test on local aem by replacing the angularjs clientlib with the angular clientlib.

 

I understand that Angular also uses typescript, so like migration might take longer than expected. 


 

good luck!

 

 

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

There are many ways to do this, but here's what I would do.

Pre-requirement is for you to actually be familiar with AngularJS vs Angular. And understanding how to migrate AngularJS components to Angular. I searched on youtube "migrate AngularJS components to Angular", (1) JavaScript Marathon: Upgrade AngularJS to Angular with Angular Elements - YouTube

 

I'll give you the most simplest high level approach.

 

start a new angular project, migrate the code from AngularJS to Angular inside of it, use a dev server during the migration to make sure everything is working as expected, and finally test on local aem by replacing the angularjs clientlib with the angular clientlib.

 

I understand that Angular also uses typescript, so like migration might take longer than expected. 


 

good luck!

 

 

Avatar

Level 8

Thanks for the input.

 

I had one question is it a good idea to move all the AEM current component *.html code to angular 2 based app.component.html code. As angular may not have so much security like slightly provides.

 

so in this mechanism in the aem current component.html will send the all the required data required as pojo object to angular 2 .In the aem component.html  will just the angular2 selector placed

 

 

 

 

Please advise

 

Thanks