【发布时间】:2015-08-15 20:33:42
【问题描述】:
我正在尝试使用 spring boot 开发一个应用程序,并且我有以下 html
<!doctype html>
<html ng-app>
<head>
<title>Hello AngularJS</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script>
<script src="hello.js"></script>
</head>
<body>
<div ng-controller="Hello">
<p>The ID is {{greeting.id}}</p>
<p>The content is {{greeting.content}}</p>
</div>
</body>
</html>
我收到此错误,但我不知道为什么,这与 https://spring.io/guides/gs/consuming-rest-angularjs/ 的示例中的代码相同
org.xml.sax.SAXParseException:与元素类型“html”关联的属性名称“ng-app”必须后跟“=”字符。
【问题讨论】:
-
我不认为 Spring Boot 在这里做了什么特别的事情。检查百里香叶设置:thymeleaf.org/doc/…。您可能还会发现此讨论很有用:github.com/spring-projects/spring-boot/issues/1270
标签: java angularjs spring spring-mvc