Angular display svg.component located on an object into the html

Viewed 17

I have this array of routes that contain a label and an icon but I think I'm doing a wrong way to display this svg.

routes = [
      {
        name: 'Inicio',
        items: [
          { label: 'Dashboard', icon: '<home-svg></home-svg>', routerLink: '/dashboard' },
        ]
      },
      {
        name: 'Cine',
        items: [
          { label: 'PelĂ­culas', icon: '<movie-svg></movie-svg>', routerLink: '/peliculas' },
          { label: 'Funciones', icon: '<funcion-svg></funcion-svg>', routerLink: '/funciones'},
          { label: 'Salas', icon: '<sala-svg></sala-svg>', routerLink: '/salas'},
          { label: 'Venta de boletas', icon: '<boleta-svg></boleta-svg>', routerLink: '/boletas'},
        ]
      }
]

So when I access this key from the HTML i just get the string, is there any way I could display it using the selector?

Thanks in advance :)

0 Answers
Related