Javascript 运行Spring启动应用程序时出现AngularJs错误

Javascript 运行Spring启动应用程序时出现AngularJs错误,javascript,angularjs,twitter-bootstrap,spring-boot,wro4j,Javascript,Angularjs,Twitter Bootstrap,Spring Boot,Wro4j,我正在从spring.io()中尝试这个教程,我得到了这个错误 错误:[$injector:moduler] $injector/modulerr?p0=hello%20&p1=%5B%24injector%3Anomod%5D%20http%3A%2F%2errors.angularjs.org%2F1.4.9%2F%24injector%2Fnomod%3Fp0%3dhhello%2520%0AM%2F%3C%40http%3A%2F%2Flocalhost%3A8080%2Fjs%2Fjs

我正在从spring.io()中尝试这个教程,我得到了这个错误

错误:[$injector:moduler] $injector/modulerr?p0=hello%20&p1=%5B%24injector%3Anomod%5D%20http%3A%2F%2errors.angularjs.org%2F1.4.9%2F%24injector%2Fnomod%3Fp0%3dhhello%2520%0AM%2F%3C%40http%3A%2F%2Flocalhost%3A8080%2Fjs%2Fjs%2Fangular bootstrap.js%3A2%3a285925%0Ahe%2F%2F%3C%2F%3A%2F%3A%2f3a%2f3a%2f3a%2f3a%2F%2F%2f3a%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%3A8080%2Fjs%2Fangular bootstrap.js%3A4%3A1258%0Ahe%2F%3C%2F%3A%2Flocalhost%3A8080%2Fjs%2Fangular bootstrap.js%3A4%3A1501%0Ag%2F%3C%40http%3A%2F%2Flocalhost%2Fjs%2Fjs%2Fangular%2fAng bootstrap.js%3A5%3A4212%0An%40http%2F%2Flocalhost%3A8080%2Fangular%2Fangular%2Fangular%2f3a8080%2Fjs%2Fangular%2Fangular%2Fangular%2ap.js%3A5%3A4060%0Adb%40http%3A%2F本地主机%3A8080%2Fjs%2F角度引导.js%3A5%3A5856%0Azc%2Fc%40http%3A%2F本地主机%3A8080%2Fjs%2F角度引导.js%3A3%3A1485%0Azc%40http%3A8080%2Fjs%2Fjs角度引导.js%3A1798%0HTTP%3A%2F本地主机%3A8080%2Fjs%2Fjs%2F角度引导%3A805%2Fjs%2F本地主机%3A%2F角度引导ost%3A8080%2Fjs%2Fangular bootstrap.js%3A14%3A20478%0An.Callbacks%2Fi%40http%3A%2F%2LocalHost%3A8080%2Fjs%2Fangular bootstrap.js%3A2%3A27146%0An.Callbacks%2Fj.fireWith%40http%3A8080%2Fjs%2Fangular bootstrap.js%3A2%3A2%2F27914%0A.ready%40http%3A%2F%2FHost%3A8080%2Fjs%2Fangular%2Fjs%3A2%2FA705%2Fangular%2Fhos%t%3A8080%2Fjs%2FANGRAL bootstrap.js%3A2%3A29890%0A

我已经创建了一个Spring启动应用程序。 这是应用程序的结构

这是我的密码:

Pom.xml

为了使wro4j正常工作,还需要设置一些属性文件。这些文件是:

  • 无主
  • wro.properties
  • wro.xml
以下是这些“wro4j”配置文件的内容

main.less是空的

wro.properties

wro.xml

当我运行应用程序时,浏览器除了显示静态内容“问候语”外,什么也不显示。不显示动态内容。浏览器控制台将以粗体显示上面显示的错误


有人能帮我解决这个问题吗?

尝试删除
ng app=“hello”
中的尾随空格,它不应该在那里。这能解决什么问题吗?是的,删除空白应该能解决问题。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" ...>
<modelVersion>4.0.0</modelVersion>

<groupId>com.skillupsoft</groupId>
<artifactId>estudent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.4.4.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
</properties>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>

        <plugin>
            <groupId>ro.isdc.wro4j</groupId>
            <artifactId>wro4j-maven-plugin</artifactId>
            <version>1.8.0</version>
            <executions>
                <execution>
                    <phase>generate-resources</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <wroManagerFactory>ro.isdc.wro.maven.plugin.manager.factory.ConfigurableWroManagerFactory</wroManagerFactory>
                <cssDestinationFolder>${project.build.directory}/classes/static/css</cssDestinationFolder>
                <jsDestinationFolder>${project.build.directory}/classes/static/js</jsDestinationFolder>
                <wroFile>${basedir}/src/main/wro/wro.xml</wroFile>
                <extraConfigFile>${basedir}/src/main/wro/wro.properties</extraConfigFile>
                <contextFolder>${basedir}/src/main/wro</contextFolder>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.webjars</groupId>
                    <artifactId>jquery</artifactId>
                    <version>2.2.4</version>
                </dependency>
                <dependency>
                    <groupId>org.webjars</groupId>
                    <artifactId>angularjs</artifactId>
                    <version>1.4.9</version>
                </dependency>
                <dependency>
                    <groupId>org.webjars</groupId>
                    <artifactId>bootstrap</artifactId>
                    <version>3.3.7-1</version>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>
<!DOCTYPE html>
<html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Hello eStudent</title>
    <link href="css/angular-bootstrap.css" rel="stylesheet">
    <style type="text/css">
        [ng\:cloak], [ng-cloak], .ng-cloak {
            display: none !important;
        }
    </style>
   </head>

<body ng-app="hello ">
<div class="container">
    <h1>Greeting</h1>
    <div ng-controller="home" ng-cloak class="ng-cloak">
        <p>The ID is {{greeting.id}}</p>
        <p>The content is {{greeting.content}}</p>
    </div>
</div>

<script src="js/angular-bootstrap.js" type="text/javascript"></script>
<script src="js/hello.js"></script>

</body>
</html>
angular.module('hello',[])
    .controller('home', function($scope) {
        $scope.greeting = {id: 'xxx', content: 'Hello World!'}
    })
#List of preProcessors
preProcessors=lessCssImport
#List of postProcessors
postProcessors=less4j,jsMin
<groups xmlns="http://www.isdc.ro/wro">
  <group name="angular-bootstrap">
    <css>webjar:bootstrap/3.3.7-1/less/bootstrap.less</css>   
    <css>file:@project.basedir@/src/main/wro/main.less</css>
    <js>webjar:jquery/2.2.4/jquery.min.js</js>
    <js>webjar:angularjs/1.4.9/angular.min.js</js>
    <js>webjar:angularjs/1.4.9/angular-route.min.js</js>
    <js>webjar:angularjs/1.4.9/angular-cookies.min.js</js>
   </group>
</groups>
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class EStudentApplication {

    public static void main(String[] args) {
        SpringApplication.run(EStudentApplication.class, args);
    }