我的所有网页都在 / WEB-INF / views / 下。我使用ng-include在index.html中包含一个页面
<div ng-include="'myPage.html'"></div>
但我得到了
获取http://localhost:8080/myPage.html 404(未找到)
这是我的configureViewResolvers:
@Override
public void configureViewResolvers(ViewResolverRegistry registry) {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setPrefix("/WEB-INF/views/");
viewResolver.setSuffix(".html");
registry.viewResolver(viewResolver);
}
答案 0 :(得分:0)
确保ng-app
之前或之外ng-include
<div ng-app="" ng-include="'WEB-INF/views/myPage.html'"></div>
,或者像
{{1}}