components icon indicating copy to clipboard operation
components copied to clipboard

Add cdk drag-and-drop features

Open jelbourn opened this issue 8 years ago • 94 comments

This issue tracks the high-level addition of drag-and-drop features to the cdk.

jelbourn avatar Dec 12 '17 19:12 jelbourn

Thanks for the report @ptoro, could you file your exact comment as an issue? I'm closing down this issue since the drag&drop is close to being released in stable and having issues in here makes them hard to track over time.

crisbeto avatar Sep 20 '18 19:09 crisbeto

Can't resolve '@angular/cdk/drag-drop'

image

https://beta-angular-material-io.firebaseapp.com/cdk/drag-drop/api#directives

unable to resolve the dependency .

Any help ? @crisbeto

narendrasinghrathore avatar Oct 17 '18 13:10 narendrasinghrathore

Try @angular/cdk/drag-drop/experimentalif you're on v6, drop experimental if you're on v7 beta

nayfin avatar Oct 17 '18 14:10 nayfin

@nayfin Didn't seem folder is here. I am using v6. image

narendrasinghrathore avatar Oct 17 '18 14:10 narendrasinghrathore

Sorry, you also need @angular/cdk-experimental: 6.4.7 in your package.json dependencies. Here's a link to a stackblitz highlighting how to connect drop zones across templates, that should help if you're still stuck. It will be a little more straightforward once v7 drops.

nayfin avatar Oct 17 '18 14:10 nayfin

@nayfin
Package "@angular/cdk-experimental" was found but does not support schematics ng add @angular/[email protected]

Is something wrong here ?

"dependencies": { "@angular/animations": "^6.1.10", "@angular/cdk": "^6.4.7", "@angular/cdk-experimental": "^6.4.7", "@angular/common": "^6.1.0", "@angular/compiler": "^6.1.0", "@angular/core": "^6.1.0", "@angular/forms": "^6.1.0", "@angular/http": "^6.1.0", "@angular/material": "^6.4.7", "@angular/platform-browser": "^6.1.0", "@angular/platform-browser-dynamic": "^6.1.0", "@angular/router": "^6.1.0", "core-js": "^2.5.4", "hammerjs": "^2.0.8", "rxjs": "^6.0.0", "zone.js": "~0.8.26" }, "devDependencies": { "@angular-devkit/build-angular": "~0.7.0", "@angular/cli": "~6.1.5", "@angular/compiler-cli": "^6.1.0", "@angular/language-service": "^6.1.0", "@types/jasmine": "~2.8.6", "@types/jasminewd2": "~2.0.3", "@types/node": "~8.9.4", "codelyzer": "~4.2.1", "jasmine-core": "~2.99.1", "jasmine-spec-reporter": "~4.2.1", "karma": "~1.7.1", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.0", "karma-jasmine": "~1.1.1", "karma-jasmine-html-reporter": "^0.2.2", "protractor": "~5.4.0", "ts-node": "~5.0.1", "tslint": "~5.9.1", "typescript": "~2.7.2" }

narendrasinghrathore avatar Oct 17 '18 14:10 narendrasinghrathore

I doubt there is a schematic for it. Just add to dependencies and npm install. Are you getting an error?

nayfin avatar Oct 17 '18 16:10 nayfin

@nayfin Did npm install `npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

up to date in 30.943s ` Seems to work But some issue, following this example https://run.stackblitz.com/api/angular/v1?file=app%2Fcdk-drag-drop-sorting-example.ts

image

narendrasinghrathore avatar Oct 17 '18 16:10 narendrasinghrathore

Those are just warnings telling you that you're using Windows

nayfin avatar Oct 17 '18 16:10 nayfin

@nayfin Any idea why such behaviour 2018-10-17_22-10-10

narendrasinghrathore avatar Oct 17 '18 16:10 narendrasinghrathore

Would you mind to move your support questions over to StackOverflow or Gitter? Everyone who follows this issue gets notified. The Angular team kindly asks to keep issues clean for bugs etc.

Please do not open issues for general support questions as we want to keep GitHub issues for bug reports and feature requests. You've got much better chances of getting your question answered on StackOverflow where the questions should be tagged with tag angular-material2.

Thanks <3

pas2al avatar Oct 17 '18 16:10 pas2al

@pas2al My bad,

Regards.

narendrasinghrathore avatar Oct 17 '18 16:10 narendrasinghrathore

@nallwhy Just for update I used version: 7.0.0-rc.1 ng add @angular/[email protected]

Is working as expected.

Thanks 2018-10-17_22-22-37

narendrasinghrathore avatar Oct 17 '18 16:10 narendrasinghrathore

Locking this thread since it's gone off-topic now. Drag-and-drop is being released as part of Angular v7. Feel free to open new issues for bug reports.

jelbourn avatar Oct 17 '18 16:10 jelbourn