When we think of using template
in Angular2 or Angular1.X, we know below is one of the basic way of writing:
template: \'./template-ninja.html\'>
I don't know of a library or tool that will cache templates for Angular 2 yet, but so far, I have been happy to just use inline templates instead of external files. Using the es6 backtick character for a template, it allows you to write multiline HTML in the JavaScript and keeps everything in one file.
https://github.com/angular-in-action/chapter2/blob/master/client/components/dashboard.ts#L12