Yes, I was recently faced with this issue.
- Create a folder for your angular 2 app, e.g. myapp
- Inside the folder create a file for a Wordpress template, e.g. myTemplate
- Template Name: mytemplate
My great angular 2+ app
*/
`get_header(); ?>
<section class="content" id="clubnavo">
<!--This is the main component -->
<app-root></app-root>
</section><!-- .content -->
<?php get_footer(); ?> `
The tricky part
5. You only need the dist, src and templlate file in this folder for production.
6. Important: Set the base href to the url of your app, e.g. http://example.com/pag1/my-app-page.
7. When building, include the base href option, ng build --base-href /pag1/my-app-page/
This took me lots of time to work out after easily getting to work for the home page. You do not need the base-href option if the app is on the home page.