yaru22 / ng-html2js

Standalone script to turn Angular template into js and put it in a module.
32 stars 19 forks source link

Fixed two (Windows) issues #1

Closed marklagendijk closed 11 years ago

marklagendijk commented 11 years ago

I ran into two issues when using ng-html2js. One issue is a Windows specific issue, the other one might or might not be an issue on Linux, I'm not sure. These issues are:

  1. Relative paths don't work (at least under Windows). When using absolute paths, the absolute path ends up in the template name.
  2. When template names contain directories, they should be separated with '/' instead of '\' (Windows only issue).

These issues are fixed as follows:

  1. Added an 'baseDir' option. 'baseDir' is subtracted from the template name. This way you can use absolute file names, while the template name will become the abolute url. Example:
  ng-html2js "C:\projects\myProject\partials\views\blah.html" -b C:\projects\myProject\ -m myApp.templates

Would result in a template name of '/partials/views/blah.html'.

  1. The '\'-es in the template name are replaced by '/'.
marklagendijk commented 11 years ago

Done!