-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
CDK Drag-Drop - Object Configuration on attributes #17921
CDK Drag-Drop - Object Configuration on attributes #17921
Comments
The problem with doing this is that changes inside the object won't be picked up by change detection, unless the entire object is swapped out. Furthermore, it introduces a second way of doing the same things as before which can make the API confusing. We currently have the |
Do you have any usage example please? I didn't find any |
I'm sorry, my previous comment was wrong. It looks like we never got around to expanding the |
Will this be like an object that I change the settings to use globally or in a specific dragdrop list without having to set the attributes in html !? |
The object would allow you to set the default values for all the lists inside a module or a component. E.g. here's how you would make all lists default to being horizontal: import {NgModule} from '@angular/core';
import {DragDropModule, CDK_DRAG_CONFIG} from '@angular/cdk/drag-drop';
@NgModule({
imports: [DragDropModule],
providers: [{
provide: CDK_DRAG_CONFIG
useValue: {
orientation: 'horizontal'
}
}]
})
export class YourModule {} |
Wow, this will make html much cleaner, especially when you have multiple lists with similar settings, let me know when you release this update please! It will be very good! |
Adds an injection token that allows consumers to change the defaults of the various options in the `drag-drop` module. Also moves some repeated inline types into shared ones. Fixes angular#17921.
Correct, this object will only configure the defaults, but then you can use the inputs to change it on each instance. I can't guarantee when it'll be released, but you can keep an eye on the PR. #17970 |
Adds an injection token that allows consumers to change the defaults of the various options in the `drag-drop` module. Also moves some repeated inline types into shared ones. Fixes angular#17921.
Adds an injection token that allows consumers to change the defaults of the various options in the `drag-drop` module. Also moves some repeated inline types into shared ones. Fixes angular#17921.
Adds an injection token that allows consumers to change the defaults of the various options in the `drag-drop` module. Also moves some repeated inline types into shared ones. Fixes angular#17921.
Adds an injection token that allows consumers to change the defaults of the various options in the `drag-drop` module. Also moves some repeated inline types into shared ones. Fixes angular#17921.
…ts (angular#17970) Adds an injection token that allows consumers to change the defaults of the various options in the `drag-drop` module. Also moves some repeated inline types into shared ones. Fixes angular#17921.
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. |
Feature Description
Implementing the possibility of elements with only one attribute and one object passing all the options, is more organized and easier to deploy.
Example:
And another for the list elements:
Use Case
Facilitates the library learning curve and also enables easier and more organized changes. could be applicable on any Angular-Drag-Drop. I don't think it's hard to do, but if you want you wouldn't need to make a bigger effort to start a deployment method since the library already provides one.
The text was updated successfully, but these errors were encountered: