Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.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 使用cdk拖放中的object.property内部谓词函数_Angular_Scope_Reference_Drag And Drop_Angular Cdk - Fatal编程技术网

Angular 使用cdk拖放中的object.property内部谓词函数

Angular 使用cdk拖放中的object.property内部谓词函数,angular,scope,reference,drag-and-drop,angular-cdk,Angular,Scope,Reference,Drag And Drop,Angular Cdk,让我们看看这个: 我希望列表基于object.property可删除 不知何故,只有当我使用公共静态变量时,它才能按预期工作 查看dynamicPredicate()函数 我有一种感觉,为什么这不能如预期的那样起作用: 谓词函数按原样发送到指令,并在那里求值 如何使谓词函数与对象属性一起工作?解决方案非常简单 我必须使用es6箭头功能: dynamicPredicate2 = () => { return this.defaultBool }

让我们看看这个:

我希望列表基于object.property可删除

不知何故,只有当我使用公共静态变量时,它才能按预期工作

  • 查看
    dynamicPredicate()
    函数
我有一种感觉,为什么这不能如预期的那样起作用: 谓词函数按原样发送到指令,并在那里求值


如何使谓词函数与对象属性一起工作?

解决方案非常简单

我必须使用es6箭头功能:

dynamicPredicate2 = () => { return this.defaultBool }