Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

AEM angular spa application

Avatar

Level 1

I am having difficulties to setup angular for AEM angular spa application. Tried with different versions but no help.can someone please help me with the angular setup and resolve build errors 

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi @VinjamuriSh,

Setting up an Angular SPA (Single Page Application) with Adobe Experience Manager (AEM) can be challenging if there are version compatibility issues or configuration problems. Here are some steps and resources that might help you resolve build errors and properly configure your Angular SPA:

Steps to Setup Angular SPA with AEM

  1. Use AEM Project Archetype:

    • Start your project using the AEM Project Archetype, which provides a structured way to create an AEM project with Angular as the frontend module. Make sure you specify frontendModule=angular when generating the project.
    • For more details, refer to the AEM Project Archetype documentation.
  2. Ensure Dependency Compatibility:

    • Check your package.json file for Angular dependencies. Ensure they are compatible with each other and with your AEM version. An example dependency setup for Angular 9.1.11 is provided in this resource.
  3. Build and Deploy with Maven:

    • Use Maven to build and deploy your project. Run the command $ mvn -PautoInstallSinglePackage clean install to compile and deploy your code to a local AEM instance. Ensure your AEM instance is running on port 4502.
    • Detailed build instructions can be found in the AEM SPA Editor Angular tutorial.
  4. Map Components:

    • Map your Angular components to AEM components using the AEM SPA Editor SDK. This allows authors to dynamically update SPA components within the AEM interface.
    • For guidance, see the SPA Editor SDK documentation.
  5. Troubleshoot Common Errors:

    • If you're encountering build errors, ensure that all paths in your angular.json and package.json files are correct and that all necessary scripts are included in your build process.
    • Check the console logs for specific error messages and address them by verifying module imports, package versions, and configuration settings.
  6. Utilize SPA Editor Tutorials:

    • Follow detailed tutorials like the WKND SPA Tutorial to understand how SPAs are structured and how to implement them effectively in AEM.

Additional Resources

  • Angular CLI Setup: Ensure you have the Angular CLI installed globally with npm install -g @angular/cli.
  • GitHub Repositories: Explore example implementations and sample code provided by Adobe on their GitHub repositories, such as aem-project-archetype.

By following these steps and utilizing the provided resources, you should be able to set up your Angular SPA with AEM and resolve any build errors you encounter. If you continue to experience difficulties, consider reaching out to the AEM community or Adobe support for further assistance.

View solution in original post

3 Replies

Avatar

Level 1

It’s working with angular 9 but all the designs are compatible to angular 18.angular 18 is not working as npm is not updated. Any solution for this problem?

Avatar

Correct answer by
Employee

Hi @VinjamuriSh,

Setting up an Angular SPA (Single Page Application) with Adobe Experience Manager (AEM) can be challenging if there are version compatibility issues or configuration problems. Here are some steps and resources that might help you resolve build errors and properly configure your Angular SPA:

Steps to Setup Angular SPA with AEM

  1. Use AEM Project Archetype:

    • Start your project using the AEM Project Archetype, which provides a structured way to create an AEM project with Angular as the frontend module. Make sure you specify frontendModule=angular when generating the project.
    • For more details, refer to the AEM Project Archetype documentation.
  2. Ensure Dependency Compatibility:

    • Check your package.json file for Angular dependencies. Ensure they are compatible with each other and with your AEM version. An example dependency setup for Angular 9.1.11 is provided in this resource.
  3. Build and Deploy with Maven:

    • Use Maven to build and deploy your project. Run the command $ mvn -PautoInstallSinglePackage clean install to compile and deploy your code to a local AEM instance. Ensure your AEM instance is running on port 4502.
    • Detailed build instructions can be found in the AEM SPA Editor Angular tutorial.
  4. Map Components:

    • Map your Angular components to AEM components using the AEM SPA Editor SDK. This allows authors to dynamically update SPA components within the AEM interface.
    • For guidance, see the SPA Editor SDK documentation.
  5. Troubleshoot Common Errors:

    • If you're encountering build errors, ensure that all paths in your angular.json and package.json files are correct and that all necessary scripts are included in your build process.
    • Check the console logs for specific error messages and address them by verifying module imports, package versions, and configuration settings.
  6. Utilize SPA Editor Tutorials:

    • Follow detailed tutorials like the WKND SPA Tutorial to understand how SPAs are structured and how to implement them effectively in AEM.

Additional Resources

  • Angular CLI Setup: Ensure you have the Angular CLI installed globally with npm install -g @angular/cli.
  • GitHub Repositories: Explore example implementations and sample code provided by Adobe on their GitHub repositories, such as aem-project-archetype.

By following these steps and utilizing the provided resources, you should be able to set up your Angular SPA with AEM and resolve any build errors you encounter. If you continue to experience difficulties, consider reaching out to the AEM community or Adobe support for further assistance.

Avatar

Employee

Hi @Khushwant_Singh,

Can you please help marking this answer as correct as we have shared all the information.