我想在属性bindLabel中有两个值的ng-select。我有这样的事情:
<ng-select placeholder="{{'TASKS.FOR_WHO' | translate }}"
name="users" [items]="users" bindLabel="firstName" >
</ng-select>
Run Code Online (Sandbox Code Playgroud)
但是在绑定标签中,我想让bindLabel = firstName + lastName。像这样:
<ng-select placeholder="{{'TASKS.FOR_WHO' | translate }}"
name="users" [items]="users" bindLabel="firstName+lastName">
</ng-select>
Run Code Online (Sandbox Code Playgroud)
如何实现呢?
我想使用我的ngStyle指令(在 HTML 中)的 CSS 文件中定义的颜色。
这是我在 HTML 中得到的内容:
[ngStyle]="{backgroundColor: isDarkStyle() ? '#29434e' : isNormalStyle() ? '#cfd8dc' : isLightStyle() ? 'white': ''}"
Run Code Online (Sandbox Code Playgroud)
这是我的带有颜色的 CSS 文件:
//colors for background
$light-background: white;
$normal-background: #cfd8dc;
$dark-background: #29434e;
Run Code Online (Sandbox Code Playgroud)
但我想要这个:
[ngStyle]="{backgroundColor: isDarkStyle() ? '$dark-background' : isNormalStyle() ? '$normal-background' : isLightStyle() ? '$light-background': ''}"
Run Code Online (Sandbox Code Playgroud)
我怎样才能达到这个结果?感谢帮助 :)