I want to have index.html from an angular 2 project to run as a welcome page of a Spring MVC application.
The way I run the angular 2 is via npm start
. If I load the index.html without doing npm start
, components do not load properly.
How will I be able to make index.html as the welcome page for my Spring MVC Project?
Edit: Added some more details.
The angular-seed project is loaded as is. I'm just trying to load the index.html from the angular-seed project. node modules have already been added and it runs perfectly with npm start
.
As for my web.xml, I have the welcome file this way:
<welcome-file-list>
<welcome-file>AngularContent/src/index.html</welcome-file>
</welcome-file-list>
And index.html has the following:
<!DOCTYPE html>
<html>
<head>
<title>Angular QuickStart</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<base href="/">
<link rel="stylesheet" href="styles.css">
<!-- Polyfill(s) for older browsers -->
<script src="AngularContent/node_modules/core-js/client/shim.min.js"></script>
<script src="AngularContent/node_modules/zone.js/dist/zone.js"></script>
<script src="AngularContent/node_modules/systemjs/dist/system.src.js"></script>
<script src="AngularContent/src/systemjs.config.js"></script>
<script>
System.import('AngularContent/src/main.js').catch(function(err){ console.error(err); });
</script>
</head>
<body>
<my-app>Loading AppComponent content here ...</my-app>
</body>
</html>