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

added support for functions #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fmillone
Copy link

@fmillone fmillone commented May 7, 2016

Hey @craigburke sorry it took me so long.
I've tried another approach to this problem.
What do you think?

example

 ngHtml2JsPreprocessor = [
        // the name of the Angular module to create
        moduleName: "templates",
        cacheIdFromPath: jsFunction("function(filepath) { return filepath.replace('grails-app/assets/javascripts', '').replace('/templates/', '/').replace('.tpl.html','.html') ; }")
    ]

generates =>

"ngHtml2JsPreprocessor": {
            "moduleName": "temoplates", "cacheIdFromPath": function (filepath) {
                return filepath.replace('grails-app/assets/javascripts', '').replace('/templates/', '/').replace('.tpl.html', '.html');
            }

@migsar
Copy link

migsar commented Sep 28, 2016

Hello,

Are there any news about this? I thought about doing this just removing the double quotes around the value of cacheIdFromPath key after the json has been converted to string. I did that in about ten lines in the KarmaModuleExtension file. I think either way it would be a nice feature to have. So what do you think?

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

Successfully merging this pull request may close these issues.

2 participants