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

need a way to inject template in script tag format #31

Open
debuggingfuture opened this issue May 8, 2014 · 4 comments
Open

need a way to inject template in script tag format #31

debuggingfuture opened this issue May 8, 2014 · 4 comments

Comments

@debuggingfuture
Copy link

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

@debuggingfuture
Copy link
Author

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

@arkarkark
Copy link

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.

@debuggingfuture
Copy link
Author

@arkarkark thanks, I am using your branch which work nice for me

@jrharshath
Copy link

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.

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

Successfully merging a pull request may close this issue.

4 participants