1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

Angular: cookie service Error Reference: i0

Discussão em 'Angular' iniciado por Elly, Outubro 10, 2024 às 07:22.

  1. Elly

    Elly Guest

    This error message in the browser console appears after I added the CookieService to my Angular app: "Error: Uncaught (in promise): ReferenceError: i0 is not defined." Here is the code related to the cookie:

    import { CookieService } from 'ngx-cookie-service';
    constructor(
    private cookieService: CookieService )
    ngOnInit(): void
    {
    // Create the form
    this.signInForm = this._formBuilder.group({
    email : ['hughes.brian@company.com', [Validators.required, Validators.email]],
    password : ['admin', Validators.required],
    rememberMe: ['']
    });
    if (this.signInForm.get('rememberMe').value) {
    const email = this.signInForm.get('email').value;
    this.cookieService.set('rememberedEmail', email, 30);
    // cookie will expire in 30 days
    }


    I already rectified the imports and install cookie-service but still don't work.

    Continue reading...

Compartilhe esta Página