4

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

1
  • 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 Commented Nov 21, 2012 at 16:58

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

4 Comments

Removing that fixing the fail to load resource (along with making the path ./templates/corestyle.html) however I am not getting an error that is just repeating over and over of : 10 $digest() iterations reached. Aborting!
without your other code, i would guess that you are 1) calling scope.$apply when you shouldn't be or 2) changing something that angular thinks you shouldn't be like an internal angular construct (something like angular.$$foo).
why would it work fine in the chrome browser but not with node-webkit (which uses chromium)?
hmm good question, you might want to research angularjs googlegroup, i seem to recall there issues with partials - particularly with chrome. Sorry, i don't have node-webkit exp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.