小编San*_*nto的帖子

angularjs错误:[$ compile:tpload]无法加载模板

我正在尝试在angularjs中构建简单的路由应用程序.我有主要的index.html页面,其中包含用于路由的ng-view div和javascript代码.另外2个简单的html页面view2.html和view3.html放在子文件夹partials1中.我收到了以下错误.请帮忙.

错误:访问被拒绝.错误:[$ compile:tpload]无法加载模板:partials1/view3.html http://errors.angularjs.org/1.3.15/ $ compile/tpload?p0 = partials1%2Fview3.html

  • index.html的:

    <div data-ng-view></div>
    
    <script src="angular.js"></script>
    <script src="angular-route.js"></script>
    <script type="text/javascript">
        var demoApp = angular.module('demoApp', [ 'ngRoute' ]);
        demoApp.controller('SimpleController', function($scope) {
            $scope.customers = [ {
                name : 'Jon Smith1',
                city : 'Charlotte'
            }, {
                name : 'John Doe',
                city : 'New York'
            }, {
                name : 'Jane Doe',
                city : 'Jacksonville'
            } ];
        });
    
        demoApp.config([ '$routeProvider', function($routeProvider) {
            $routeProvider.when('/view1', {
                templateUrl : 'partials1/view3.html',
                controller : 'SimpleController'
            }).when('/view2', {
                templateUrl : 'partials1/view2.html',
                controller : …
    Run Code Online (Sandbox Code Playgroud)

html javascript angularjs angularjs-routing

7
推荐指数
1
解决办法
4万
查看次数

报告期间不考虑在pluginManagement中添加的依赖项

我正在尝试配置用于报告的Maven Checkstyle插件,并想将Checkstyle的依赖项更改为7.5,而不是默认的6.11.2。

为了实现这一点,我pluginManagement在父pom中声明了依赖项。在子项目中,我只是在报告标记中引用插件。

但是我看到默认的Checkstyle(6.11.2)正在下载到存储库中。请参阅下面的父母子女pom。

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mycompany.app</groupId>
  <artifactId>parent_app</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>parent_app</name>
  <modules>
    <module>my-app2</module>
  </modules>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-checkstyle-plugin</artifactId>
          <version>2.17</version>
          <dependencies>
            <dependency>
              <groupId>com.puppycrawl.tools</groupId>
              <artifactId>checkstyle</artifactId>
              <version>7.5</version>
            </dependency>
          </dependencies>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
Run Code Online (Sandbox Code Playgroud)

子pom.xml

 <?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>com.mycompany.app</groupId>
    <artifactId>parent_app</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <groupId>com.mycompany.app</groupId>
  <artifactId>my-app2</artifactId>
  <version>1.0-SNAPSHOT</version>
  <name>my-app2</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
   <reporting>
    <plugins>
        <plugin>
            <artifactId>maven-checkstyle-plugin</artifactId>
            <configuration>
                <configLocation>src/main/resources/checkstyle.xml</configLocation>
            </configuration>
            <reportSets>
                <reportSet>
                    <reports>
                        <report>checkstyle</report> …
Run Code Online (Sandbox Code Playgroud)

java checkstyle maven

4
推荐指数
1
解决办法
270
查看次数