Angularjs 安圭拉路线。不工作模板URL

Angularjs 安圭拉路线。不工作模板URL,angularjs,nw.js,angularjs-ng-route,Angularjs,Nw.js,Angularjs Ng Route,它不适用于指定的templateUrl:test.html,但在指定模板“Hello”时有效 工作 我有一个标志即#/测试 链接 我使用的是nw.js您可以尝试为模板url设置路径 .when('/test', { templateUrl: './test.html', controller: 'ctrl' }) 显示放置test.html文件的文件夹结构参考此 app.config(function($routeProvider){ $routeProvider

它不适用于指定的templateUrl:test.html,但在指定模板“Hello”时有效

工作

我有一个标志
#/测试

链接



我使用的是nw.js

您可以尝试为模板url设置路径

.when('/test', {
   templateUrl: './test.html',
   controller: 'ctrl'
  })

显示放置test.html文件的文件夹结构参考此
app.config(function($routeProvider){
    $routeProvider
    .when('/test', {
        templateUrl: 'test.html',
        controller: 'ctrl'
    })

    // .otherwise({
    //  redirectTo: '/home',
    //  controller: 'ProductCtrl'
    // });
});
<a style="color:white;" href="#!/test">Go</a>
.when('/test', {
   templateUrl: './test.html',
   controller: 'ctrl'
  })