我已按照以下页面的所有说明设置Angular开发环境: https://github.com/angelozerr/angularjs-eclipse/wiki/Getting-Started 当我在本地apache服务器上运行我的应用时,浏览器会显示角度预编译代码。
如果我在Google Chrome浏览器中浏览该应用,则效果非常好。
我忘记了什么?
这是应用的代码: 的 的
的 <!DOCTYPE html>
<html>
<head>
<title>Guess The Number !</title>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all"/>
<link href="css/bootstrap-theme.min.css"/>
<script src="js/angular.min.js"></script>
</head>
<body ng-app="app">
<div class="container" ng-controller="GuessTheNumberController">
<h2>Guess the Number !</h2>
<p class="well lead">Guess the computer generated random number between 1 and 1000.</p>
<label>Your Guess: </label><input type="number" ng-model="guess"/>
<button ng-click="verifyGuess()" class="btn btn-primary btn-sm">Verify</button>
<button ng-click="initializeGame()" class="btn btn-warning btn-sm">Restart</button>
<p ng-show="deviation>0" class="alert alert-warning">Your guess is higher.</p>
<p ng-show="deviation<0" class="alert alert-warning">Your guess is lower.</p>
<p ng-show="deviation===0" class="alert alert-success">Yes! That"s it.</p>
<p class="text-info">No of guesses : <span class="badge">{{noOfTries}}</span><p>
</div>
<script type="text/javascript">
angular.module('app',[])
.controller('GuessTheNumberController', GuessTheNumberController);
function GuessTheNumberController($scope) {
$scope.verifyGuess = function () {
$scope.deviation = $scope.original - $scope.guess;
$scope.noOfTries = $scope.noOfTries + 1;
}
$scope.initializeGame=function() {
$scope.noOfTries = 0;
$scope.original = Math.floor((Math.random() * 1000) + 1);
$scope.guess = null;
$scope.deviation = null;
}
$scope.initializeGame();
}
</script>
</body>
</html>
的
Eclipse Browser显示以下内容:
Guess the Number !
Guess the computer generated random number between 1 and 1000.
Your Guess: Verify Restart
Your guess is higher.
Your guess is lower.
Yes! That"s it.
No of guesses : {{noOfTries}}
本地控制台日志: 的 的
的may 28, 2015 11:54:39 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:AngularJS' did not find a matching property.
may 28, 2015 11:54:39 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
ADVERTENCIA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:GuessTheNumber' did not find a matching property.
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Server version: Apache Tomcat/8.0.23
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Server built: May 19 2015 14:58:38 UTC
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Server number: 8.0.23.0
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: OS Name: Windows 7
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: OS Version: 6.1
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Architecture: x86
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Java Home: C:\Program Files\Java\jdk1.8.0_45\jre
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: JVM Version: 1.8.0_45-b15
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: JVM Vendor: Oracle Corporation
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: CATALINA_BASE: C:\Users\Uda\Workspaces\angularJS\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: CATALINA_HOME: C:\Programacion\apache-tomcat-8.0.23
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Dcatalina.base=C:\Users\Uda\Workspaces\angularJS\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Dcatalina.home=C:\Programacion\apache-tomcat-8.0.23
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Dwtp.deploy=C:\Users\Uda\Workspaces\angularJS\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Djava.endorsed.dirs=C:\Programacion\apache-tomcat-8.0.23\endorsed
may 28, 2015 11:54:39 PM org.apache.catalina.startup.VersionLoggerListener log
INFORMACIÓN: Command line argument: -Dfile.encoding=Cp1252
may 28, 2015 11:54:39 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFORMACIÓN: La biblioteca nativa de Apache Tomcat basada en ARP que permite un rendimiento óptimo en entornos de desarrollo no ha sido hallada en java.library.path: C:\Program Files\Java\jdk1.8.0_45\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\Users\Uda\AppData\Roaming\npm;.
may 28, 2015 11:54:40 PM org.apache.coyote.AbstractProtocol init
INFORMACIÓN: Initializing ProtocolHandler ["http-nio-8080"]
may 28, 2015 11:54:40 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMACIÓN: Using a shared selector for servlet write/read
may 28, 2015 11:54:40 PM org.apache.coyote.AbstractProtocol init
INFORMACIÓN: Initializing ProtocolHandler ["ajp-nio-8009"]
may 28, 2015 11:54:40 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFORMACIÓN: Using a shared selector for servlet write/read
may 28, 2015 11:54:40 PM org.apache.catalina.startup.Catalina load
INFORMACIÓN: Initialization processed in 2521 ms
may 28, 2015 11:54:40 PM org.apache.catalina.core.StandardService startInternal
INFORMACIÓN: Arrancando servicio Catalina
may 28, 2015 11:54:40 PM org.apache.catalina.core.StandardEngine startInternal
INFORMACIÓN: Starting Servlet Engine: Apache Tomcat/8.0.23
may 28, 2015 11:54:41 PM org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
INFORMACIÓN: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [168] milliseconds.
may 28, 2015 11:54:41 PM org.apache.coyote.AbstractProtocol start
INFORMACIÓN: Starting ProtocolHandler ["http-nio-8080"]
may 28, 2015 11:54:41 PM org.apache.coyote.AbstractProtocol start
INFORMACIÓN: Starting ProtocolHandler ["ajp-nio-8009"]
may 28, 2015 11:54:41 PM org.apache.catalina.startup.Catalina start
INFORMACIÓN: Server startup in 1248 ms
的
Chrome控制台: 无法加载资源:服务器响应状态为404(未找到)