Can't import my custom Date class in Angular 19

Discussão em 'Angular' iniciado por Sean, Maio 5, 2025.

  1. Sean

    Sean Guest

    In Angular 15, I used code like so:

    import { DateSearchOptions, DateSearchResponse, Date } from '../../common/models/date.model';


    ...and life was good. I've just upgraded to Angular 19, but now get date.select.component.ts:18 Uncaught TypeError: Date2.now is not a function in all files where I import the Date class. Apparently the solution is to call my class something other than Date, or to alias the import wherever it is used. Both are extensive changes - I can't believe that I have to do this because Angular now optimizes/injects things more aggressively. Is there any known fix/workaround?

    Continue reading...

Compartilhe esta Página