This repository contains 2 applications :
- my-angular-app : basic angular application
- symposium-portal : Liferay DXP project with a portlet based on the angular app
The application (scaffolded wuth angular-cli) is very basic as its only purpose is to showcase the workflow used to deploy it on the Liferay DXP portal.
Points of interest are :
LazyModule
: this module is meant to be lazy loaded (checkapp-routing.module.ts
)package.json
: look at thebuild:prod
script as it includes the--deploy-url
option which is required for the lazy loading of modules to work properly.
This project is a simple Liferay DXP portal with only one portal : my-angular-portlet
which is used to deploy the
angular application into the portal in which we called embedded
mode.
It's a very simple portlet, the interesting parts are :
view.jsp
: you'll find- the base angular application tag (
<app-root></app-root>
) - the various imports needed for the angular application to boot (
main.js
,polyfills.js
,runtime.js
)
- the base angular application tag (
pom.xml
: in this demo project, instead of using a profile, we directly configure themaven-resources-plugin
to copy files fromdist
local directory of my-angular-app.
The project my-angular-app
is a fully independant angular application, and thus can be directly started using ng serve
in the directory my-angular-app
. As usual, it will be available on localhost:4200
.
- Start the liferay portal
- Package the angular application by using the command
yarn build:prod
- Launch the build and deployment of the portlet
my-angular-portlet
with a simplemvn clean install
- log into the portal (test@liferay.com / test) and place the portlet anywhere : you should have the exact same application than the standalone mode.