带有node-webkit的AngularJS

前端之家收集整理的这篇文章主要介绍了带有node-webkit的AngularJS前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我现在正在评估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...

这是正在压缩的内容.

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

– 更新 –

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

解决方法

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

猜你在找的Angularjs相关文章