Template veiwer


I use Atom with Angular (version 1) and have been converting my code to use components. Each component has a template object which is basically a string version of html. When the template is small it is easy to understand but when the template gets large it is difficult to view.

Is there any package which will take the template string, convert it html and show it in a popup window?


I’m not sure what a “string version of html” looks like. Mind sharing a link to some code?


here is an screenshot example of a component

The template is the green text at the bottom of the image.


So I found something that does what you want, but it’s for CoffeeScript, not JavaScript. If you look at line 37 of the grammar file, you can see where it matches for a leading template: and then includes the HTML grammar for text within the matched area.

Your goal would involve something similar. It would check for strings that look like templates, include HTML for those strings, and include the standard JavaScript grammar for everything else.


Thanks it will give me a start on how to produce an add-in for Atom - May be a while as I am right up against it (time wise) for the next few weeks.