-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(schematics): create drag-drop schematic #13368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(schematics): create drag-drop schematic #13368
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
0 3px 14px 2px rgba(0, 0, 0, 0.12); | ||
} | ||
|
||
/* Items that are being dropped should not show up twice. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop this comment. It's up to the consumer whether they want the placeholder to show up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, will change.
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [ <%= classify(name) %>Component ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this going to end up with extra space inside the square brackets? E.g. [ MyComponent ]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, but this is consistent with the default Angular schematics (https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/component/files/__name%40dasherize%40if-flat__/__name%40dasherize__.component.spec.ts#L11)
expect(tree.files).toContain('/projects/material/src/app/foo/foo.component.scss'); | ||
}); | ||
|
||
it('should fallback to the @schematics/angular:component option value', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fallback -> fall back. Same goes for some of the other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we basically have this in other test files as well. I will fix this one here, but have a follow-up for the other spec files.
<div class="container"> | ||
<h2>To do</h2> | ||
|
||
<cdk-drop #todoList [data]="todo" [connectedTo]="[doneList]" class="list" (dropped)="drop($event)"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The connectedTo
accepts a single reference as well: [connectedTo]="doneList"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've basically taken this from your example on material.angular.io
. What's your preference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say passing in the single one since it's a bit cleaner.
e048e8a
to
f93e523
Compare
f93e523
to
12fcd39
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @devversion! This PR has merge conflicts due to recent upstream merges. |
* Creates a CDK schematic that can be used to generate a component that uses the CDK Drag & Drop module. The code is based on the `sorting` example of the drag-drop (just a bit trimmed to keep the code simple)
12fcd39
to
4206e6e
Compare
* Creates a CDK schematic that can be used to generate a component that uses the CDK Drag & Drop module. The code is based on the `sorting` example of the drag-drop (just a bit trimmed to keep the code simple)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
sorting
example of the drag-drop (just a bit trimmed to keep the code simple)