I\'ve seen working examples when is beeing used inside other nested components (like here) but I haven\'t managed to run it inside a root Ang
Turns out it's possible, if you intend to provide textual content. If you want Angular components, it's possible with the right HTML element (noscript). A little hacky, one might say. The trick is using a element.
HTML template:
Root component:
import {Component, bootstrap} from 'angular2/angular2';
@Component({
selector: 'app',
template: 'Header: ' + window.mainTemplate ,
})
export class App {
}
bootstrap(App);
Make sure your Angular 2 code comes after the template definition.
Only applies if you use a tag: The catch is that since recently (http://angularjs.blogspot.com.br/2016/02/angular-2-templates-will-it-parse.html) Angular 2 brings its own parser, templates are case-sensitive. It is not the case for HTML in a browser environment. It means the browser may not keep the case in attributes and elements on this template hack.
UPDATE: I had a element in the original solution. A is much better as shouldn't be any case conversion.