I agree with Gunther's answer as he answers my question.
For those who are interested in how I solved my problem, this is to create a component and require it.
I created a dumb component:
import {Component} from '@angular/core'; @Component({ selector: 'flat-buttons', template: require('./flatButtons.html'), }) export class FlatButtons { constructor() { } }
And then my modified html template:
<div class="col-sm-6 col-xs-12"> <mi-card title="Flat Buttons" baCardClass="with-scroll button-panel"> <flat-buttons></flat-buttons> </mi-card> </div> <div class="col-sm-6 col-xs-12"> <h3>Code Snippet</h3> <div class="well"> <pre>{{getFlatButtons()}}</pre> </div> </div>
And my modified component code:
private flatButtons = require('./components/flatButtons/flatButtons.html') constructor() {} getFlatButtons() { return html_beautify(this.flatButtons, this.options) }
source share