【发布时间】:2017-10-18 07:15:00
【问题描述】:
它不适用于指定的templateUrl:test.html,但如果您指定模板则可以:'Hello'
工作
app.config(function($routeProvider){
$routeProvider
.when('/test', {
template: '<h1>home</h1>',
controller: 'ctrl'
})
// .otherwise({
// redirectTo: '/home',
// controller: 'ProductCtrl'
// });
});
不要工作
app.config(function($routeProvider){
$routeProvider
.when('/test', {
templateUrl: 'test.html',
controller: 'ctrl'
})
// .otherwise({
// redirectTo: '/home',
// controller: 'ProductCtrl'
// });
});
我在#!/test文件的路径中有一个符号!
链接
<a style="color:white;" href="#!/test">Go</a>
我正在使用 nw.js
【问题讨论】:
-
显示您放置 test.html 文件的文件夹结构
标签: angularjs nw.js angularjs-ng-route