Git Product home page Git Product logo

Comments (7)

vojtajina avatar vojtajina commented on June 2, 2024

This is fixed - now the html2js preprocessor is configurable karma-runner/karma-ng-html2js-preprocessor@5b59ac6

In your karma.conf.js, you can do:

karma.configure({
  ngHtml2JsPreprocessor: {
    stripPrefix: 'app/views'
  }
});

You will however need to wait a bit to get this released... or use karma@canary channel...

from ng-directive-testing.

bennick avatar bennick commented on June 2, 2024

Thanks for the fix! I tried out canary but got banged up a little bit. I'll make due until stable is released.

from ng-directive-testing.

Rheaxu avatar Rheaxu commented on June 2, 2024

@bennick I got exactly the same problem. Does vojtajina's solution work for you? It doesn't work for me.

from ng-directive-testing.

bennick avatar bennick commented on June 2, 2024

@Rheaxu I believe it did at the time. These days I put template files directly in a /public directly so that Rails routing is not involved in serving them. This fixes any issues Rails routing was causing, the templates are loaded faster, and it forces me to keep them simple.

from ng-directive-testing.

Rheaxu avatar Rheaxu commented on June 2, 2024

@bennick Actually, it worked. Maybe I misspelled something. Sorry! And thanks for your post, it saves my day!

from ng-directive-testing.

bennick avatar bennick commented on June 2, 2024

@Rheaxu Great to hear.

from ng-directive-testing.

indranilatwork avatar indranilatwork commented on June 2, 2024

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?

from ng-directive-testing.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.