Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
Change the type of an a element

I have an <a> element that may or may not have an href attribute.

If this element doesn't have an href element, I get the following error from google.

Links are not crawlable.

Do we have a way to change the type of an <a> element and tell to the bot that this isn't a link anymore ?

<a [href]="url">{{ text }}</a>

Or is as follow the only way

<a *ngIf="url" [href]="url">{{ text }}</a>
<p *ngIf="!url">{{ text }}</p>

The best would be an angular solution, but any javascript is welcome.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

As @cloned mentioned, this the a-element need to have an href.

Here's how I have deal with a more complex angular example, since I wanted to change the type of the a-element to avoid copying myself.

<a
  *ngIf="attributes?.url"
  [href]="attributes.url"
>
  <ng-container *ngTemplateOutlet="customContent"></ng-container>
</a>
<div *ngIf="!attributes?.url">
  <ng-container *ngTemplateOutlet="customContent"></ng-container>
</div>

<ng-template #customContent>
  <!-- The lot of content my element needed to be inside -->
</ng-template>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda