我现在正在评估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,