Created
May 20, 2015 22:06
-
-
Save alexandreaquiles/49981ea0071efe0261a3 to your computer and use it in GitHub Desktop.
Exemplo de filtro com o AngularJS.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html ng-app> | |
<head> | |
<title>Mirror Fashion</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width"> | |
<link href="../css/reset.css" rel="stylesheet"/> | |
<link href="../css/estilos.css" rel="stylesheet"/> | |
<link href="../css/pesquisa.css" rel="stylesheet" media="screen"/> | |
</head> | |
<body> | |
<header class="container"> | |
<h1>Mirror Fashion</h1> | |
<p class="sacola" data-total = "0"> | |
Nenhum item na sacola de compra | |
</p> | |
<nav class="menu-setores"> | |
<ul> | |
<li><a href="#">Sua Conta</a></li> | |
<li><a href="#">Lista de Desejos</a></li> | |
<li><a href="#">Cartão Fidelidade</a></li> | |
<li><a href="sobre.html">Sobre</a></li> | |
<li><a href="#">Ajuda</a></li> | |
</ul> | |
</nav> | |
</header> | |
<div id="principal" class="container"> | |
<div class="filtro"> | |
<input type="text" placeholder="Nome, preço ou código" ng-model="busca"/> | |
</div> | |
<ul id="carrinho" ng-controller="ProdutoController"> | |
<li ng-repeat="produto in produtos | filter:busca" id="item{{produto.id}}" class="clearfix"> | |
<div class="painel-imagem" title> | |
<img ng-src="../{{produto.imagem}}" /> | |
</div> | |
<div class="item-info"> | |
<h2>{{produto.nome}}</h2> | |
<p>CÓDIGO: <span>{{produto.codigo}}</span></p> | |
<p>Valor unitário: <span id="item-valor-unit">{{produto.preco | currency}}</span></p> | |
<a href="#" class="adicionar">Adicionar</a> | |
</div> | |
</li> | |
</ul> | |
</div><!-- fim do conteudo principal --> | |
<footer> | |
<div class="container"> | |
<h1>Mirror Fashion</h1> | |
<ul class="social"> | |
<li><a href="http://facebook.com/mirrorfashion">Facebook</a></li> | |
<li><a href="http://twitter.com/mirrorfashion">Twitter</a></li> | |
<li><a href="http://plus.google.com/mirrorfashion">Google+</a></li> | |
</ul> | |
</div> | |
</footer> | |
<script src="../js/lib/angular.js"></script> | |
<script src="../js/controller/ProdutoController.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment