Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html2js-preprocessor adding relative template url #84

Open
indranilatwork opened this issue Nov 28, 2015 · 2 comments
Open

html2js-preprocessor adding relative template url #84

indranilatwork opened this issue Nov 28, 2015 · 2 comments

Comments

@indranilatwork
Copy link

My project folder is at var/www/apps/angular/myproject

And the templates are in the templates folder under myproject.

So the template url is specified in the directive is "/template/directive.html"

So in the karma config I've written

ngHtml2JsPreprocessor: {
stripPrefix: 'var/www/apps/angular/myproject',
moduleName: "my.templates"
},

And this config works. But I don't want to specify the full path to the project in the config because for some other environment this might change. But "myproject" folder will be always there.

So I tried with stripPrefix: '*/myproject',
But it didn't work.
Please tell me how I can fix it?

@nicfusc
Copy link

nicfusc commented Jan 14, 2016

One way I got around this was to use Nodes path module.

I set this before the Karma configuration

var path = require('path');

Then set the basepath as

basePath: path.resolve(),

Might help until relative paths are available.

@NickMurphy
Copy link

I set my base path to the root of the folder, './', and it fixed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants