Coder Social home page Coder Social logo

Comments (4)

inorganik avatar inorganik commented on July 24, 2024

Well this did make me discover a bug in the way I handled ngOnChanges - so I pushed a patch - 7.1.1.

If you want to keep updating CountUp, you can do so just by updating the value you pass:

app.component.ts:

  newNum = 10;
  options = {
    useEasing: false,
    duration: 3
  }

  update() {
    this.newNum += 10;
    console.log('update', this.newNum);
  }

app.component.html:

<h2 [countUp]="newNum" [reanimateOnClick]="false" [options]="options" (complete)="update()"></h2>

https://stackblitz.com/edit/angular-countup-eygnty

from ngx-countup.

MUYUSY avatar MUYUSY commented on July 24, 2024

Well this did make me discover a bug in the way I handled ngOnChanges - so I pushed a patch - 7.1.1.

If you want to keep updating CountUp, you can do so just by updating the value you pass:

app.component.ts:

  newNum = 10;
  options = {
    useEasing: false,
    duration: 3
  }

  update() {
    this.newNum += 10;
    console.log('update', this.newNum);
  }

app.component.html:

<h2 [countUp]="newNum" [reanimateOnClick]="false" [options]="options" (complete)="update()"></h2>

https://stackblitz.com/edit/angular-countup-eygnty

Thanks very much, I got it. But mention that this can only use with the patch after 7.1, since I was using 7.0 which did not support.

from ngx-countup.

inorganik avatar inorganik commented on July 24, 2024

Yep, that ability was added in 7.1 (due to another issue). If your issue is resolved, can this be closed?

from ngx-countup.

MUYUSY avatar MUYUSY commented on July 24, 2024

Yep, thanks a lot.

from ngx-countup.

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.