karma-ng-html2js-preprocessor
karma-ng-html2js-preprocessor copied to clipboard
need a way to inject template in script tag format
I find this library a nice idea & soling the problem.
for some reason my templates are in the script tag format, which then include & pick up by PHP.
<script type="text/ng-template" id="templateId.html">
<p>This is the content of the template</p>
</script>
with ng-html2js, the whole thing will be treated as the template itself i.e. $templateCache.get('templateId.html') will get the script tags as well
so the approach perhaps a script tag regex is good enough
which sth like content = content.replace(/<script[^>]*>\n*/g,'').replace(/\n*<\/script>/g,''); at L20 html2js.js is good for me, assuming the id follow convention as in the path
I also need support for this syntax, although to make it more complicated, I have multiple
script type="text/ng-template" in a single file, so I'll need to pull out the id's and add them to the template cache by id.
@arkarkark thanks, I am using your branch which work nice for me
This can be resolved if someone can create a new PR corresponding to #42 - or point me to some guide to contributing to this project, so I can do it myself.