Create your first Angular SPA in AEM introduction

[For publishing from AEM Sites using Edge Delivery Services, click here.]{class="badge positive" title="Publish from AEM to Edge Delivery Services"}

Welcome to a multi-part tutorial designed for developers new to the SPA Editor feature in Adobe Experience Manager (AEM). This tutorial walks through the implementation of a Angular application for a fictitious lifestyle brand, the WKND. The Angular app is developed and designed to be deployed with AEM’s SPA Editor, which maps Angular components to AEM components. The completed SPA, deployed to AEM, can be dynamically authored with traditional in-line editing tools of AEM.

Final SPA Implemented

WKND SPA Implementation

About

The goal for this multi-part tutorial is to teach a developer how to implement an Angular application to work with the SPA Editor feature of AEM. In a real-world scenario the development activities are broken down by persona, often involving a Front End developer and a Back End developer. We believe it is beneficial for any developer involved in an AEM SPA Editor project to complete this tutorial.

The tutorial is designed to work with AEM as a Cloud Service and is backwards compatible with AEM 6.5.4+ and AEM 6.4.8+. The SPA is implemented using:

Estimate 1-2 hours to get through each part of the tutorial.

Latest Code

All of the tutorial code can be found on GitHub.

The latest code base is available as downloadable AEM Packages.

Prerequisites

Before starting this tutorial, you’ll need the following:

While not required, it is beneficial to have a basic understanding of developing traditional AEM Sites components.

Local Development Environment local-dev-environment

A local development environment is necessary to complete this tutorial. Screenshots and video are captured using the AEM as a Cloud Service SDK running on a Mac OS environment with Visual Studio Code as the IDE. Commands and code should be independent of the local operating system, unless otherwise noted.

Next Steps next-steps

What are you waiting for?! Start the tutorial by navigating to the SPA Editor Project chapter and learn how to generate a SPA Editor enabled project using the AEM Project Archetype.

Backward compatibility compatibility

The project code for this tutorial was built for AEM as a Cloud Service. In order to make the project code backward compatible for 6.5.4+ and 6.4.8+ several modifications have been made.

The UberJar v6.4.4 has been included as a dependency:

<!-- Adobe AEM 6.x Dependencies -->
<dependency>
    <groupId>com.adobe.aem</groupId>
    <artifactId>uber-jar</artifactId>
    <version>6.4.4</version>
    <classifier>apis</classifier>
    <scope>provided</scope>
</dependency>

An additional Maven profile, named classic has been added to modify the build to target AEM 6.x environments:

  <!-- AEM 6.x Profile to include Core Components-->
    <profile>
        <id>classic</id>
        <activation>
            <activeByDefault>false</activeByDefault>
        </activation>
        <build>
        ...
    </profile>

The classic profile is disabled by default. If following the tutorial with AEM 6.x please add the classic profile whenever instructed to perform a Maven build:

$ mvn clean install -PautoInstallSinglePackage -Pclassic

When generating a new project for an AEM implementation always use the latest version of the AEM Project Archetype and update the aemVersion to target your intended version of AEM.

recommendation-more-help
e25b6834-e87f-4ff3-ba56-4cd16cdfdec4