Adding Angular application to existing page

Enonic version: EnonicXP
OS: Mac OS

Hi! I’m new to Enonic and I have briefly read the documentation on creating webapps for EnonicXP.
I would like to hear from anyone who has embedded an Angular app in your Enonic project for some pointers.

1 Like

Hi, Farrukh!

I haven’t embedded an Angular app in any of my Enonic projects, but I’ve worked with React which is quite similar, embedding-wise. In your Enonic app you can for instance write code that creates a container HTML element that points to your Angular app by using the ng-app HTML attribute, and then you add the resources (client-side JavaScript and static HTML, etc.) for that Angular app inside the /src/main/resources/assets directory in your Enonic project. Then make sure that your page controller in Enonic includes these assets, by outputting the result of the assetUrl() function in lib-portal on the page HTML.

Best wishes,
Bjørnar