Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

208
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!