Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 在不在角度模式下工作的组件上添加自定义禁用输入_Angular - Fatal编程技术网

Angular 在不在角度模式下工作的组件上添加自定义禁用输入

Angular 在不在角度模式下工作的组件上添加自定义禁用输入,angular,Angular,我有一个角度的组件,其中包含一个按钮 我已将组件设置为禁用输入名称,如下所示: export class ConfirmationButtonComponent implements OnInit { @Input() icon: string; @Input() tooltip: string; @Input() disabled: boolean; <app-confirmation-button [icon]="'select-all'" disa

我有一个角度的组件,其中包含一个按钮

我已将组件设置为禁用输入名称,如下所示:

export class ConfirmationButtonComponent implements OnInit {
  @Input() icon: string;
  @Input() tooltip: string;
  @Input() disabled: boolean;
  <app-confirmation-button 
    [icon]="'select-all'"
    disabled="missions.length === 0"
    tooltip="{{ 'BUTTON.DELETE_ALL' | translate}}"
我这样称呼它:

export class ConfirmationButtonComponent implements OnInit {
  @Input() icon: string;
  @Input() tooltip: string;
  @Input() disabled: boolean;
  <app-confirmation-button 
    [icon]="'select-all'"
    disabled="missions.length === 0"
    tooltip="{{ 'BUTTON.DELETE_ALL' | translate}}"
然后我试着用另一种方法

  <app-confirmation-button 
    [icon]="'select-all'"
    disabled="{{missions.length === 0}}"
    tooltip="{{ 'BUTTON.DELETE_ALL' | translate}}"
所以是字符串而不是布尔值


如何得到布尔值

确定我使用
[disabled]
修复了此问题。我将阅读有关使用
[
和不使用
绑定的内容