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

Module is not created for external templates #87

Open
perezperret opened this issue Feb 4, 2016 · 3 comments
Open

Module is not created for external templates #87

perezperret opened this issue Feb 4, 2016 · 3 comments

Comments

@perezperret
Copy link

I am using JSPM, so my config is a bit different from the usual examples. In my karma.config.j file I am loading the templates the following way:

...    
    jspm: {
        loadFiles: [
            'spec/**/*.spec.js',
            'dist/app.js',
        ],
        serveFiles: [
            'dist/**/*.html',
            'dist/**/*.js',
            'dist/**/*.js.map',
        ],
    },
...

And configuring the plugin this way:

...   
    preprocessors: {
        'dist/**/*.html': ['ng-html2js']
    },

    ngHtml2JsPreprocessor: {
        moduleName: 'templates'
    },
...

When I run karma with debug-level logging I can see the correct templates being processed, but I can't mock them in the tests using the module name (angular.mock.module('templates')) nor in the debugger.

For reference I am running OS X 10.10.5, Chrome 48.0.2564.97 (64-bit) and Firefox 30.0.0.

@perezperret
Copy link
Author

perezperret commented May 20, 2016

For further reference, this issue was solved by moving the html files to ...jspm: {loadFiles: ..., which probably makes sense

@cyrixmorten
Copy link

Just had the exact same issue with same solution.

It makes sense that the html must be served correctly, but had a hard time realising that this could in any way be a reason for the preprocessor not to create the 'templates' module?
I would have expected to find my solution elsewhere.

@That-David-Guy
Copy link

Thanks @perezperret , had the exact same problem here with JSPM

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