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

how to get a file path from assets folder with just knowing a string in it's name in angular 17

Discussão em 'Angular' iniciado por jitesh vijay, Setembro 16, 2024.

  1. jitesh vijay

    jitesh vijay Guest

    i have a file with a name main-5WAPJH7.js in a child project's folder whose dist is contained in assets folder of my another project. I want to load this file in a component so that the child project runs in that component. But the string after main- keeps on changing when dist folder is created. I want to get the path of this file using just 'main'.

    This is the code that loads scripts:- const scripts = [ 'assets/projects/observability/main-5WAPJFH7.js' ];

    styles.forEach(styleUrl => {
    const link = this.renderer.createElement('link');
    link.rel = 'stylesheet';
    link.href = styleUrl;
    this.renderer.appendChild(document.head, link);
    });

    Continue reading...

Compartilhe esta Página