在Angular 6中,属性字符串插值的最佳实践是什么?
我有这段代码:
<div class="container" [ngStyle]="{'grid-template-rows': 'repeat(' + value + ', 1fr) [last-line]'}">
我想使用类似于 'repeat(${value})'
带反引号的语法。
在Angular 6中,属性字符串插值的最佳实践是什么?
我有这段代码:
<div class="container" [ngStyle]="{'grid-template-rows': 'repeat(' + value + ', 1fr) [last-line]'}">
我想使用类似于 'repeat(${value})'
带反引号的语法。
calculateStyle(value: string): string {
return `repeat(${value}, 1fr) [last-line]`;
}
<someComponent
someProperty="{{someObj?.anotherProp}}{{someVar ? ' [TEST]' : null}}">
</someComponent>