I have a Angular 11 project and I want to use the drag and drop from Material.
It works well but I would like to customize it a bit.
I wanted to use the Class DropListRef to make the container horizontal as it seems that css does not work on the drag and drop module, at least, now how I want it.
But when I inject in the constructor the DropListRef, I have access to its method but I have an error that says that no provider is provided (pun intended) for it.
And when I put the DropListRef in the ngModule Provider array, it returns an error (as I understand it, Class are not supposed to be put in the provider).
Though I do not know how to make it work.
If someone can help me.
constructor(public contentService: ContentService, private papa: Papa, private dropListRef: DropListRef) {
this.csvForm = new FormGroup({});
this.dropListRef.withDirection('ltr').withOrientation('horizontal');
}
As requested, here is a StackBlitz with the issues :
https://stackblitz.com/edit/angular-ivy-9smng4?file=src%2Fapp%2Fapp.module.ts
If we remove the DropListRef from the providers, we get the second error.
Cheers
question from:
https://stackoverflow.com/questions/65845356/angular-material-no-provider-for-droplistref 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…