question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

doesn't work with angular 9 version

See original GitHub issue

I have an error in console, when try to import TimeAgoPipe and add to module declarations.

So, little “crutch” like that solved my problem

...
import { TimeAgoPipe } from 'time-ago-pipe';

@Pipe({
    name: 'timeAgo',
    pure: false
})
export class TimeAgoExtendsPipe extends TimeAgoPipe {}

@NgModule({
    declarations: [
        TimeAgoExtendsPipe,
...

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:39
  • Comments:18

github_iconTop GitHub Comments

7reactions
Nasun4ocommented, Mar 23, 2020

Same problem with Angular 9.

5reactions
larsnedbcommented, Jun 3, 2020

It does work in Angular 9 with one little modification:

import {Pipe, PipeTransform} from '@angular/core';
import {TimeAgoPipe} from 'time-ago-pipe';

@Pipe({
  name: 'timeAgo',
  pure: false
})
export class TimeAgoExtendsPipePipe extends TimeAgoPipe implements PipeTransform {

  transform(value: string): string {
    return super.transform(value);
  }
}

Note that you have to implement PipeTransform in order to not get compilation error on @Pipe. Not sure why I both have to extend a class which implements an interface AND implement the interface. But this TimeAgo has caused me enough troubles now, so I’m happy enough as long as it is working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular CLI version is not compatible with Angular version
The Problem. The CLI version you have installed doesn't meet the requirements for your Angular version as the error says:
Read more >
Version 9 of Angular Now Available — Project Ivy has arrived!
The 9.0.0 release of Angular is here! This is a major release that spans the entire platform, including the framework, Angular Material, and...
Read more >
Angular 9 for Beginners — How to Install Your First App with ...
But this doesn't mean Angular is not important anymore. On the. ... As a front end developer, I have worked with Angular.
Read more >
Angular CLI update issues: Manually Update your ... - Medium
At the time of writing, you should see version 7.x.x. This is the correct version. This is where the first issue rears its...
Read more >
How To Update Angular CLI To Latest Version
Then run npm cache verify command to clear the node packages cache. ... This flag is not required, once final version of Angular...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found