Javascript ngrouteProvider不是';我的案子不管用
我的代码 我调试了几个小时,仍然找不到问题所在。控制台中未显示任何错误。它说当我转到localhost/myproject/#/action时找不到对象 这是路由的正确用法吗Javascript ngrouteProvider不是';我的案子不管用,javascript,angularjs,Javascript,Angularjs,我的代码 我调试了几个小时,仍然找不到问题所在。控制台中未显示任何错误。它说当我转到localhost/myproject/#/action时找不到对象 这是路由的正确用法吗 app.config(function($routeProvider) { $routeProvider .when('/action/:index', { templateUrl: 'edit.html', controller: 'MainControl'
app.config(function($routeProvider) {
$routeProvider
.when('/action/:index', {
templateUrl: 'edit.html',
controller: 'MainControl'
});
})
当您转到
myproject/#/action
时,您实际上没有匹配此模式/action/:index
,您还必须在路由定义中添加/action
,以使其正常工作可能问题出在您的服务器配置中。。。对于路径localhost/project
,是否正确设置为仅返回index.html
?@doodeec是的,这有什么问题?假设我可以看到index.html末尾的#符号,但它看起来不像平常。