0

I want to hide a div with just titles, the div with the content is in another section

<div>
    <b>Entrega\</b>

    <div class="custom-control">ID da Entrega: </div>

    <div class="custom-control">ID Estoque de Origem: </div>

    <div class="custom-control">ID Itenção de Venda: </div>

    <div class="custom-control">Situação</div>

    <div class="custom-control">CNPJ Entregador</div>

    <div class="custom-control">Empresa Entregadora</div>

    <div class="custom-control">CNPJ Vendedor</div>

    <div class="custom-control">Empresa Vendedora</div>

    <div class="custom-control">DH Entrega</div>

    <div class="custom-control">DH Cancelamento</div>

    <div class="custom-control">Gerado por cancelamento? </div>

    <div class="custom-control">ID gerado por cancelamento Entrega</div>

    <div class="custom-control">ID Entrega Origem Cancel. Saída</div>

    <div class="custom-control">Motivo Cancelamento: </div>
</div>

to hide the div when there is no content

3
  • How do you add the content to those divs? Maybe you could use ngIf directive, for example within a ngFor, if the content is coming from an array. Commented Jan 26, 2023 at 15:17
  • the content is on JSON file but is linked like this: <div class="custom-control" >{{est.entregas.id_entrega}}</div> <div class="custom-control" >{{est.entregas.id_entrega}}</div> <div class="custom-control" >{{est.entregas.id_estoque}}</div> <div class="custom-control" >{{est.entregas.id_intencao_venda}}</div> <div class="custom-control" >{{est.entregas.estado_entrega}}</div> <div class="custom-control" >{{est.entregas.cnpj_cons_entregador}}</div> <div class="custom-control" >{{est.entregas.cons_entregador}}</div> <div class="custom-control" >{{est.entregas.cons_vendedor}}</div> Commented Jan 26, 2023 at 16:01
  • to hide a div, you can just add style="visibility:hidden;" Commented Jan 26, 2023 at 20:41

1 Answer 1

1

You could put those divs in the template like this:

<div class="custom-control" *ngIf="est?.entregas?.id_entrega" >{{est.entregas.id_entrega}}</div>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.