Hello I need to do the number counts with animation in angular 2 . I have a example in Jquery. I need to achieve this in angular 2. I need to do like the below example Codepen Example
try below code :
$ npm install ng2-odometer --save
app.module.ts
import { Ng2OdometerModule } from 'ng2-odometer';
import { FormsModule } from '@angular/forms';
@NgModule({
declarations: [
AppComponent,
DashboardComponent,
],
imports: [
HttpClientModule,
BrowserModule,
AppRoutingModule,FormsModule,
Ng2OdometerModule.forRoot(),
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
home.html
<div style="font-size: 30px;color: white;">
<ng2-odometer [number]="number" [config]="{ }"></ng2-odometer>
</div>
home.ts
export class HomeComponent implements OnInit {
public number: number = 1000;
constructor() { }
ngOnInit() {
}
}
more info
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With