Dynamically load HTML template in angular2
I have created a project using angular-cli which contains AppComponent as follows: import { Component } from '@angular/core'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { title = 'app works!'; } And app.component.html as <h1> Good Morning, {{title}} </h1> So when I build it with ng build it generates some files like this ./dist/main.bundle.js which contents some code as follows- /* 586 */ /***/ function(module, exports) { module.exports = "<h1>\n Good Morning, {{title}}\n</h1>\n" /***/ }, /* 587 */