-
-
Save prabirshrestha/3830907 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // current implementation of JavaScriptHtmlTemplatePipeline | |
| (function(d) { | |
| var addTemplate = function(id, content) { | |
| var script = d.createElement('script'); | |
| script.type = 'text/html'; | |
| script.id = id; | |
| if (typeof script.textContent !== 'undefined') { | |
| script.textContent = content; | |
| } else { | |
| script.innerText = content; | |
| } | |
| var x = d.getElementsByTagName('script')[0]; | |
| x.parentNode.insertBefore(script, x); | |
| }; | |
| addTemplate("todo/index","<div id=\"todo-container\">\r\n Todo\r\n</div>"); | |
| }(document)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| JST || (JST = {}); | |
| JST["todo/index"] = "<div id=\"todo-container\">\r\n Todo\r\n</div>"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // allow source to be preprocessed too | |
| JST || (JST = {}); | |
| JST["todo/index"] = ....compiled template from server (so no need to compile it in client side)...; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment