-
Notifications
You must be signed in to change notification settings - Fork 99
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
Not working as component with ng-content #260
Comments
any workaround? This library is not useful without this functionality, since u would have to copy past navigation logic in every component |
This library doesn't support this functionality at the moment. Duplicate #207 . I'm very busy with work recently. If you like to help, a PR is more than welcome. 😄 |
You can wrap your ng-content with a drag-scroll-item wrapper as a workaround.
|
why would I need carousel with one item? can u provide a full example in case I didn't get you right? |
Sorry, I should've mentioned that this work around only will work for one large item. Multi-item drag-scroll with ng-content is not supported by the library at the moment. |
Got it, thanks. Then I would have to copypast it everywhere for now |
As a walk-around, it does work with ngFor, so we can pass the data to the component as an @input. Not great, but better than copy pasting... |
each carousel needs it's own design, how do you propose to pass array of custom html elements to the component? |
Maybe the code owner can guide us about why this is not working and we can all find a solution. |
@Viktor-Bredihin True that each carousel has its own design, but still, making components reusable is very important. For example, I have a carousel where I have arrows for the next and previous, this behavior is independent of the content of the carousel. With the current design, I need to make 3 different carousels that look exactly the same which have the exact same behavior, just because the content of them is different. Pseudo code of the ideal solution:
With only one implementation for my-carousel:
The only option right now is
And in the implementation of carousel-one:
And in the implementation of carousel-two:
so I need two exact carousels.... a lot of code duplication. When I want to change the behavior of one of them I need to update the others too. |
while fixing the bug. It worked for me. |
@romulodanzot it should be |
I'm submitting a ...
What is the current behavior?
The component is not working when elements are provided with
<ng-content>
. I think it is useful to have this component inside another component, the motivation is to customize style and buttons, so it is reusable throughout the app.Demo:
https://stackblitz.com/edit/angular-ivy-rpqrxh
This should work from my point of view, not sure what is causing it not to work.
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: