Angularjs (e.g. angular 1) had this convenient behaviour of searching for a element which had the id of the given templ
If anyone is interested, i found a simple workaround (a cleaner solution would be better, though)
function template(url, viewdef) {
var elt = document.getElementById(url);
if (elt && elt.getAttribute('type') == 'text/ng-template') {
viewdef.template = elt.innerHTML;
} else
viewdef.templateUrl = url;
return viewdef;
}
@View(template('mytemplate.html', {
directives: [NgIf /*required directives*/]
}))
class MyComponent{}
But it assumes that the