角材料cdkDragFreeDragPosition错误

时间:2019-12-12 20:15:51

标签: angular typescript angular-material

当我将version: '3' services: couchdb: image: "couchdb:2" restart: always ports: - 5984:5984 volumes: - ./data/couchdb:/opt/couchdb/etc/ - ./data/couchdb_config:/opt/couchdb/etc/local.d environment: - COUCHDB_USER=myuser - COUCHDB_PASSWORD=mypassword 添加到div时,出现以下错误:

enter image description here

我尝试应用相同的示例:https://stackblitz.com/angular/bxalqlqlaly?file=src%2Fapp%2Fcdk-drag-drop-free-drag-position-example.ts

示例:

[cdkDragFreeDragPosition]

1 个答案:

答案 0 :(得分:0)

您需要在NgModule中导入 DragDropModule 。之后,只有拖放才能起作用。请参考此链接以获取更多信息。 https://material.angular.io/cdk/drag-drop/overview