Angularjs   发布时间:2022-04-20  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了带有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,

大佬总结

以上是大佬教程为你收集整理的带有node-webkit的AngularJS全部内容,希望文章能够帮你解决带有node-webkit的AngularJS所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: