ryanzec
ryanzec

Reputation: 28040

AngularJS with node-webkit

I am right now evaluating node-webkit as a possible solution for building desktop application with web technologies and have a slight issue. The application is using AngularJS and the issue I am running into is that is does not seem to be properly loading my html template files.

My test application has this config:

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'});
}]);

The issue is that I am getting the following error:

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

I have tried a number of different format for the templateUrl including:

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

But I keep getting this error. Also my directory structure is:

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

This is what is being zipped up.

Do you know why I might be getting this error?

- UPDATE -

Not sure what is going on here but just updated my code (the web version I am building) and everything is working fine now. Must have been something weird in the older code

Upvotes: 4

Views: 2952

Answers (1)

Dan Doyon
Dan Doyon

Reputation: 6720

I have yet to use html5mode, but therein lies the problem. $locationProvider,

Upvotes: 1

Related Questions