Skip to content

Not working as component with ng-content  #260

Open
@blasco

Description

@blasco
  • I'm submitting a ...

    • bug report
    • feature request
    • support request => Please do not submit support request here, see note at the top of this template.
  • 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

  • What is the expected behavior?
    <drag-scroll style="width:100px" #navComponent>
          <ng-content></ng-content>
    </drag-scroll>
    
    <button (click)="moveLeft()">Left</button>
    <button (click)="moveRight()">Right</button>
    <button (click)="moveTo(2)">Last</button>

This should work from my point of view, not sure what is causing it not to work.

  • Please tell us about your environment:

    • Version: Angular 9, latest version of ngx-drag-scroll
    • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions