Comments (19)
@AurelieV Doesn't seem to work for me, the error is still happening.
from ngx-moment.
This could be related:
http://www.syntaxsuccess.com/viewarticle/timeouts-and-timerwrapper-in-angular-2.0
from ngx-moment.
from ngx-moment.
Can you please create a small plunker example the reproduces the issue?
from ngx-moment.
@urish the problem is that I dont know how to reproduce it exactly, it seems to be a timing issue and seems to occur very very rare. My suggestion would be to replace the setTimeout
calls with the TimerWrapper
but it is just a guess...
from ngx-moment.
Hi, can you please check if this fixes the issue for you?
https://github.com/urish/angular2-moment/blob/issue-48/src/TimeAgoPipe.ts
Thanks!
from ngx-moment.
@urish Although you asked @bzums, I've checked and it seems the problem goes away with the issue-48
branch. Imho merge and release! :)
from ngx-moment.
Thanks @ivoviz !
Can you please describe how you checked it?
from ngx-moment.
@urish Basically I have a site where I use amTimeAgo
50+ times / page. When I have that many elements and the times are between 0-60 minutes ago (so they should change approx. every minute) the errors occur really easily, basically every minute, or even more often. Using your patch I've left the site there for half an hour and it's still functioning, not a single error.
from ngx-moment.
Thanks @ivoviz ! And are all the timers updating as they should?
from ngx-moment.
I'm not sure about that, it seems like there are cases when the timers don't update, I'll see if I can reproduce.
from ngx-moment.
@urish Actually the timers never update on their own, sadly. Unless there's an other change, they stay exactly the same.
from ngx-moment.
@ivoviz Thanks for the input! For now we will not merge the PR, at least until there is a good solution for the timers not updating problem.
from ngx-moment.
@ivoviz @urish juste add cdr.detectChanges() in the timeOut callback and it will normally works :)
I have the same case as @ivoviz (lot of components inferior to one minute) and it works for me.
this._currentTimer = window.setTimeout(() => {
this._cdRef.markForCheck();
this._cdRef.detectChanges();
}, timeToUpdate);
Can you please test it, and I will be glad to add a PR if it works for everybody
from ngx-moment.
@AurelieV I would gladly test this, just a quick question before: Is this change based on the master, or #55?
from ngx-moment.
@ivoviz on master
from ngx-moment.
@ivoviz Damn. I think it is still the way to explore, we just have to find the good time to call it :s.
from ngx-moment.
I have read and all doc talks about calling detectChanges() as @AurelieV code.
can someone do a pluckr with the example of the problem? I would be great to track the problem and possible fixes.
Just for the record:
michaelbromley/ngx-pagination#69
angular/angular#6005
from ngx-moment.
Not sure if this still happens with angular 2.0.1. If relevant, please reopen.
from ngx-moment.
Related Issues (20)
- amDateFormat does not refresh and and the browser is frozen
- Tslib missing from package.json file HOT 3
- amDuration set Humanize optionnal or create new pipe
- Check value emptiness in LocalTimePipe HOT 1
- Angular 8/9 HOT 1
- [docs] improve docs, how to import to core module HOT 1
- Support ng-add schematics HOT 1
- Setting relativeTimeThresholdOptions object doesn't work HOT 3
- Pipe could not be found with Angular 9 (Ivy enabled by default) HOT 7
- Problems with moment 2.25.0 HOT 16
- Getting warnings and errors related to moment and ngx-moment during compilation (ng serve) along with broken-page for timeago pipe HOT 1
- can't use amLocale with amLocal HOT 2
- ERROR Error: AddPipe: missing required arguments while using amAdd HOT 1
- ModuleWithProviders usage without type parameter no longer supported in angular 10. HOT 2
- Moment start with wrong time
- momentConstructor$a is not a function HOT 1
- i get warnings about pipes not being found despite importing everything HOT 2
- Errors since update to latest version (6.0.0) HOT 22
- Angular 13 + ngx-moment 6.0.2: This module is declared with using 'export = HOT 9
- amDateFormat - momentConstructor$9 is not a function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-moment.