Including a base64 image as a string const in an Angular project

Discussão em 'Angular' iniciado por ebakunin, Junho 25, 2025.

  1. ebakunin

    ebakunin Guest

    I have several base64-encoded images for use in an Angular project (currently in Angular 19). Since some are used more than once, I do not want to embed them in a template. Instead, I would like to import them from somewhere.

    I am considering saving them as a string const in a .ts file and importing them just like any other constant. Is this a good approach or is there a more optimal way to include them in a template?

    Continue reading...

Compartilhe esta Página