简体   繁体   English

在Angular组件上添加Remove List指令

[英]Add Remove List directives on Angular components

I'm looking for a way to add/remove/list directives dynamically on Angular Components. 我正在寻找一种在Angular Components上动态添加/删除/列出指令的方法。 More concretely, I'm using the Angular Material's Drag & Drop feature and I want to dynamically enable/disable the cdkDropList directive. 更具体地说,我正在使用Angular Material的拖放功能,并且我想动态地启用/禁用cdkDropList指令。

Anyone has an amazing idea to achieve this ? 任何人都有一个惊人的想法来实现这一目标? Thx 谢谢

just add cdkDragDisabled="variableTrueOrFalse" 只需添加cdkDragDisabled =“ variableTrueOrFalse”

answer found on github https://github.com/angular/material2/issues/13651 在github上找到答案https://github.com/angular/material2/issues/13651

and for the commit explanation : https://github.com/angular/material2/commit/282e5cdddaffc2d7b3821f848b7b046aba51e01d 并为提交解释: https : //github.com/angular/material2/commit/282e5cdddaffc2d7b3821f848b7b046aba51e01d

Have a nice day ! 祝你今天愉快 !

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM