izupet / angular2-counto

Angular 2 package for nice count animations
MIT License
40 stars 13 forks source link

How to do a number pipe like numscroller.js without currency symbol and without decimals increament #16

Closed MohamedSahir closed 6 years ago

MohamedSahir commented 7 years ago

when passing dynamic value ,getting error. In app.component.html

`
  <div counto [step]="30" [countTo]="value'" [countFrom]="0" [duration]="4" (countoChange)="counto = $event" (countoEnd)="onCountoEnd()">{{counto | currency:'e':true:'1.2-2'}}</div>`

Here for [countTo] attribute passing the value from component .

For app.component.ts

export class AppComponent {
  value=10;
}

I don't need the currency symbol and if i give count to value 10 means it wll increase from 0 to 10 , don't need decimal digits increment.

O/p: needed like http://demo.tinywall.net/numscroller/

Is there any builtin pipe is there or need to right custom pipe for this.

luffySAMA commented 7 years ago

Maybe you are looking for counto | number : '1.0-0'?

ymongo commented 5 years ago

Hello there, I went through the same issue, thanks @luffySAMA for sharing your knowledge.

@izupet Could you append your documentation with a least this crucial piece of information?

Thank you all!