Angular 7 and Ionic 4 Problem
Crypt0Graphic opened this issue · comments
Crypt0Graphic commented
Animation does not work in ionic/angular project. Just shows static number.
Angular 7.2.12, Ionic 4.2.0
Console Error:
ERROR TypeError: Cannot read property 'reset' of undefined
at CountUpDirective.push../node_modules/countup.js-angular2/fesm5/countup.js-angular2.js.CountUpDirective.animate (countup.js-angular2.js:59)
at CountUpDirective.push../node_modules/countup.js-angular2/fesm5/countup.js-angular2.js.CountUpDirective.onClick (countup.js-angular2.js:28)
at Object.eval [as handleEvent] (PrepHomePage.html:51)
at handleEvent (core.js:23107)
at callWithDebugContext (core.js:24177)
at Object.debugHandleEvent [as handleEvent] (core.js:23904)
at dispatchEvent (core.js:20556)
at core.js:21003
at HTMLHeadingElement.<anonymous> (platform-browser.js:993)
at ZoneDelegate.push../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
Jamie Perkins commented
So this.countUp
in count-up.directive.ts never got created. Can you paste the markup which uses the directive?
Jamie Perkins commented
You might try updating, I recently pushed a bugfix in v7.1.1
.
Jamie Perkins commented
@Crypt0Graphic please let me know if 7.1.1 fixes
Chris Marx commented
7.2.0 is working for me with Angular 8, but I'm not using Ionic-
AbdulAzeez Olanrewaju commented
Now working,
Add Module in both app.module.ts and the component you want to use it...
Mine is result.module.ts
Answered by Stackoverflow
Jamie Perkins commented
Closing this since the answer above is the solution. Thanks @I-am-abdulazeez