带有node-webkit的AngularJS

时间:2012-11-20 15:16:18

标签: angularjs node-webkit

我现在正在评估node-webkit作为使用Web技术构建桌面应用程序的可能解决方案,并且存在一些问题。应用程序正在使用AngularJS,我遇到的问题似乎是没有正确加载我的html模板文件。

我的测试应用程序有这个配置:

nucleusApps.config(['$locationProvider', '$routeProvider', function($locationProvider, $routeProvider) {
  $locationProvider.html5Mode(true);
  $routeProvider
    .when('/style', {
      templateUrl: '/templates/core/style.html',
      controller: nucleusApps.controllers.Style
    })
    .otherwise({redirectTo: '/style'});
}]);

问题是我收到以下错误:

Failed to load resource     file://templates/core/style.html

我为templateUrl尝试了许多不同的格式,包括:

./templates/core/style.html
file://template/core/style.html

但我一直收到这个错误。我的目录结构也是:

-index.html
-package.json
-css
  -file.css
  -etc...
-templates
  -core
    style.html
-etc...

这是正在压缩的内容。

你知道为什么我会收到这个错误吗?

- 更新 -

不知道这里发生了什么,只是更新了我的代码(我正在构建的网络版),现在一切正常。在旧代码中一定是奇怪的东西

1 个答案:

答案 0 :(得分:1)

我还没有使用html5mode,但其中存在问题。 $locationProvider,

相关问题