Coder Social home page Coder Social logo

Comments (6)

sconix avatar sconix commented on August 16, 2024 1

Upcoming version 4.5.0 has been refactored to avoid duplicate code, i.e. component now uses the directive.

from ngx-perfect-scrollbar.

lazarljubenovic avatar lazarljubenovic commented on August 16, 2024

What about a structural directive? Then you could use it anywhere and there would be no additional markup and (imo) weird constraint about using div

from ngx-perfect-scrollbar.

sconix avatar sconix commented on August 16, 2024

Not sure what you mean? There should not be any constraints when using the directive

from ngx-perfect-scrollbar.

lazarljubenovic avatar lazarljubenovic commented on August 16, 2024

Yeah, my bad wording with "constraints" up there.

It's just a first-impression kind of idea (didn't check out the source in details) that instead of maintaining both

<div [perfect-scrollbar]="config"></div>

and

<perfect-scrollbar class="container" [config]="config">
  <div class="content">Scrollable content</div>
</perfect-scrollbar>

it might make more sense to API like

<div *perfectScrollbar="config">content</div>

which is anyway just sugar for

<ng-template [perfectScrollbar]="config">
  <div>content</div>
</ng-template>

Also it semantically really looks more like a structural directive since the purpose of the lib is to change the structure (the scrollbars don't just change the look and feel, they also add additional behavior).

from ngx-perfect-scrollbar.

sconix avatar sconix commented on August 16, 2024

Yes thats how the directive option works. This library provides both directive and component. The component provides makes the basic use case little bit easier, but the directive is which you want to use for most cases.

from ngx-perfect-scrollbar.

sconix avatar sconix commented on August 16, 2024

Atm component duplicates directive code and thats why this issues exists. I havent even decided if the component lives on but there is no harm to ship with both.

from ngx-perfect-scrollbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.