Unable to run angular JS app in apache tomcat

别来无恙 提交于 2019-12-13 18:19:47

问题


I have created a Dynamic web project in eclipse IDE. And converted it to angular JS project. I have successfully installed and configured Apache Tomcat 9.0 and I am able to access tomcat on localhost:8080

Below shown is my project directory structure...

When I am trying to run the application on apache server,I am getting error as shown below.........

Below is my code.

controller.js:

var app = angular.module("myApp", [" "]);

index.html:

<!DOCTYPE html>
<html>

  <meta charset="utf-8">
  <title>AngularJS</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Angular JS -->  
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>



<!-- Bootstrap CDN -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>


<!-- Controller.js -->
<script src="controller.js"></script>

<body ng-app="myApp">

<div ng-view></div>

<h6>Sample Angular JS App</h6>
</body>
</html>

来源:https://stackoverflow.com/questions/50598376/unable-to-run-angular-js-app-in-apache-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!