小编rab*_*ble的帖子

Angular UI Router在使用grunt构建后不使用模板缓存

在使用Grunt构建我的应用程序后,ui.router仍在尝试访问templateUrl URL.由于这些已经被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'
        }
      }
    })
Run Code Online (Sandbox Code Playgroud)

这在我使用grunt服务时有效,但在构建应用程序时会中断

[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) …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs gruntjs

2
推荐指数
1
解决办法
2360
查看次数

标签 统计

angularjs ×1

gruntjs ×1

javascript ×1