1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Injecting a service in Angular using a Symbol does not work in Firefox

Discussão em 'Angular' iniciado por Conde, Outubro 8, 2024.

  1. Conde

    Conde Guest

    My Angular app works in Chrome.

    export interface UserService {
    me(): Observable<Response<User>>;
    }

    export const UserServiceRef = Symbol();

    ----

    providers: [
    {
    provide: UserServiceRef,
    useClass: UserServiceGqlImpl,
    },


    However, I get this error in Firefox.

    ERROR TypeError: WeakMap key Symbol() must be an object


    If I change it this way, then it doesn't give the error anymore.

    export const UserServiceRef = 'UserServiceRef';


    Can anyone help me?

    Continue reading...

Compartilhe esta Página