Git Product home page Git Product logo

Comments (7)

rikschennink avatar rikschennink commented on May 22, 2024

Fork and go for it! 👍

Maybe it's possible to have Fitty as a dependency of the Angular directive (the directive wrapping it) so it's easy to update the directive to the latest version?

from fitty.

klsdfr avatar klsdfr commented on May 22, 2024

@lazarljubenovic do you have a hint how to import and use the module in Angular correctly?

I imported the module with
import fitty from 'fitty';

and then declared the fitty elements
this.fitties = fitty('.fit', { minSize: 50, maxSize: 300, multiLine: true });

and it worked, but when it comes to the updating on keyup-events it won't work:
this.fitties.fit();

It tells me that fitties are undefined.

from fitty.

rikschennink avatar rikschennink commented on May 22, 2024

@klsdfr Maybe Angular generates new DOM nodes when the page changes and therefore the references are lost? Or is the fitties variable undefined? If that's the case, it might be a scope issue.

from fitty.

klsdfr avatar klsdfr commented on May 22, 2024

@rikschennink it's more a problem of importing the module in a correct way via Typescript. That's why @lazarljubenovic wanted to create the directive.

Would be great to have a hint, how to be able to import it correctly in Typescript.

from fitty.

rikschennink avatar rikschennink commented on May 22, 2024

@klsdfr I've got zero experience with Typescript, so unfortunately, for the moment, I can't help with anything related to it.

from fitty.

kodeine avatar kodeine commented on May 22, 2024

anyone was able to make it work on angular 5?

from fitty.

klsdfr avatar klsdfr commented on May 22, 2024

Just try my solution from above. It works well with angular 2-6.

from fitty.

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.