【发布时间】:2015-09-21 20:47:18
【问题描述】:
在使用 Grunt 构建我的应用程序后,ui.router 仍在尝试访问 templateUrl 网址。由于这些已由 ngTemplates 连接,因此这不起作用,我只会收到一些 404 错误。
我是新手,不太明白我在做什么
$stateProvider
.state("home", {
url: "/",
views: {
'master': {templateUrl: '/views/main.html'},
"view-left@home": {
templateUrl: '/views/list.html'
},
"view-right@home": {
templateUrl: '/views/page.html'
}
}
})
这在我使用 grunt serve 时有效,但在我构建应用程序时会中断
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (main.html, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (page.html, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (list.html, line 0)
如果您需要更多信息,请告诉我,我不确定什么是相关的。
编辑:
grunt.registerTask('build', [
'clean:dist',
'wiredep',
'useminPrepare',
'concurrent:dist',
'autoprefixer',
'ngtemplates',
'concat',
'ngAnnotate',
'copy:dist',
'cdnify',
'cssmin',
'uglify',
'filerev',
'usemin',
'htmlmin'
]);
这是我的构建任务。
【问题讨论】:
-
你的构建任务是什么样的?
-
@rabble 您能否发布您的“ngtemplates”配置。
标签: javascript angularjs gruntjs