I'm using AngularJS in a project where I need to display a list of photos of products registered in the system and my html
looks like this:
// Titulo para a área de produtos
<div class="header-products">
<h3>Produtos</h3>
</div>
// Ng-repeat para listar os produtos, somente serão exibidos produtos com foto
<div class="photo" ng-repeat="product in products | limitTo: 3" ng-if="product.imageUrl">
<img ng-src="{{ product.imageUrl }}" alt="{{ product.name }}"
title="{{ product.name }}" ng-if="product.imageUrl" />
</div>
but% header-products should only be displayed if at least one product in my list has a photo, if it does not have any photos, it does not display this div
. In the list will always have the name of the products but you can not have the photo:
[
{produto: 'lapis', imageUrl: 'url-da-imagem'},
{produto: 'caneta', imageUrl: 'url-da-imagem'},
{produto: 'borracha', imageUrl: ''}
]
How can I do this if my header
is out of header
?