@Componentのinterpolationプロパティでテンプレート文字列の囲い文字を変更
@Componentのinterpolationプロパティにでテンプレート文字列の囲い文字を変更することができます。
interpolationプロパティに対して[‘{%’, ‘%}’]といったような配列で新たな囲い文字を指定します。
@Component({
selector: 'app-root',
template: `
{% foo %}
`,
interpolation: ['{%', '%}']
})
export class appComponent {
private foo:string = 'Hello World!'
}
参考URL
Introduce InterpolationConfig into component by laco0416 · Pull Request #9158 · angular/angular
登録日 : 2017年01月30日 最終更新日 : 2017年1月31日