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

207
Vistas
How to create a condition to hide and show a video in Angular?

In our homepage we have a video presentation. I would like to know know how to replicate this video in every product page which contains a video, if the product hasn't a video the video should be hidden.

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

0

You can use the *ngIf statement on the container of your video with the condition of if the product has a video.

about 4 years ago · Juan Pablo Isaza Denunciar

0

To Create an condition you can use the *ngIf directive and provide your condition in your HTML page. Here I have provided a sample code for your reference

HTML:

<div class="container" style="max-width: 550px">
    <h2 class="text-center mb-5">Angular Login with Google</h2>
  
    <div *ngIf="isVideo === false">
      <p>No Video found</p>
    </div>
  
    <div *ngIf="isVideo === true">
      <video width="320" height="240" controls>
        <source src="movie.mp4" type="video/mp4">
     </video>
  </div>

Method in component.ts:

ngOnInit(): void {
  this.Service.getvideos.subscribe((videoid) => {
      this.isVideo = (videoid != null);
      
    });
  }
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