Angular 剑道角度只读属性

Angular 剑道角度只读属性,angular,kendo-ui,Angular,Kendo Ui,我正在使用剑道ui和angular进行一个web项目。我有一个弹出式表单,当我点击编辑选项时就会看到。我想根据我的折扣列使我的弹出表单不可编辑。如果折扣值为false我应该能够编辑弹出窗口中的值,否则我应该无法编辑它 这是我的plunker url: 任何帮助都将不胜感激 谢谢。在GridEditFormComponent中,您可以获得产品模型作为输入。您只需检查模型值并禁用/启用表单: @Input() public set model(product: Product) { this

我正在使用剑道ui和angular进行一个web项目。我有一个弹出式表单,当我点击编辑选项时就会看到。我想根据我的
折扣
列使我的弹出表单不可编辑。如果折扣值为
false
我应该能够编辑弹出窗口中的值,否则我应该无法编辑它

这是我的plunker url:

任何帮助都将不胜感激


谢谢。

在GridEditFormComponent中,您可以获得产品模型作为输入。您只需检查模型值并禁用/启用表单:

@Input() public set model(product: Product) {
    this.editForm.reset(product);

    this.active = product !== undefined;

    // if(product) checks if product is not null or undefinded here
    if(product && product.Discontinued) {
      this.editForm.disable();
    }
    else {
      this.editForm.enable();
    }
}