Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for standalone components #67

Open
BojanKogoj opened this issue Aug 21, 2023 · 1 comment
Open

Support for standalone components #67

BojanKogoj opened this issue Aug 21, 2023 · 1 comment

Comments

@BojanKogoj
Copy link

BojanKogoj commented Aug 21, 2023

Since Angular 16 many of us are moving to standalone components. Any chance usage without modules could be supported?

In the meantime, this is a solution I used to get it working

main.ts

export const appConfig: ApplicationConfig = {
  providers: [
    ...
    importProvidersFrom(TimeagoModule.forRoot()),
  ],
};

bootstrapApplication(AppComponent, appConfig)...

example.component.ts

@Component({
  standalone: true,
  imports: [CommonModule, TimeagoModule],
  template: `{{ '2023-08-21T14:54:38.342Z' | timeago }}`,
})
export class ExampleComponent { ... }

StackBlitz example

@ihym
Copy link
Owner

ihym commented Aug 21, 2023

If you open a PR I'd happily review it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants