This is a way to make live.js work with templates. Tested with Ionic and Angular. Should work with pretty much any framework as long as you specify the routerURL in the script.
As mentioned in issue #1 the routerURL detection is not very strong.
issue #1 suggests to make the regex stronger which is a good goal but a maybe that should only be used as fallback of a better way to get the templateURLs which I will suggest in this issue.
Currently after getting all the JS and CSS the live-template.js code set's out another AJAX call to fetch the apps router a second time. The question is; why fetch a second time? It's already there.
After all is done loading we can simply detect which MV* framework is used and based on that retrieve the templateURLs through the app.router object. No fragile algorithm.
I'm not sure how easy this is as everybody can build their app the way they want... I could be this is a solution that is way more robust than a regex.
Could make this optional by checking for one time all the urls at initialization and searching for a file that looks like it has a router in it.
router.js app.js routes.js