<!DOCTYPE html>
<html lang="pt-br" ng-app="alurapic">
<head>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>Alurapic</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/bootstrap-theme.min.css">
<link rel="stylesheet" href="css/efeitos.css">
<script src="js/lib/angular.min.js"></script>
<script src="js/lib/angular-animate.min.js"></script>
<script src="js/lib/angular-route.min.js"></script>
<script src="js/main.js"></script>
<script src="js/FotosController.js" ></script>
<script src="js/directives/minhasDiretivas.js"></script>
</head>
<body>
<div class="container">
<ng-view></ng-view>
</div><!-- fim container -->
</body>
</html>
<!-- public/partials/principal.html -->
<div class="jumbotron">
<h1 class="text-center">Alurapic</h1>
</div>
<div class="row">
<div class="col-md-12">
<form>
<input class="form-control" placeholder="filtrar pelo título da foto" ng-model="filtro" ng-model-options="{ debounce: 500 }">
</form>
</div> <!-- fim col-md-12 -->
</div> <!-- fim row -->
<div class="row">
<meu-painel class="col-md-2 painel-animado" ng-repeat="foto in fotos | filter: filtro" titulo="{{foto.titulo}}">
<minha-foto url="{{foto.url}}" titulo="{{foto.titulo}}"></minha-foto>
</meu-painel>
</div>
angular.module('alurapic', ['minhasDiretivas', 'ngAnimate', 'ngRoute'])
.config(function($routeProvider, $locationProvider) {
$locationProvider.html5Mode(true);
$routeProvider.when('/fotos', {
templateUrl: 'partials/principal.html',
controller: 'FotosController'
});
// foto no singular!
$routeProvider.when('/fotos/new', {
templateUrl: 'partials/foto.html'
});
$routeProvider.otherwise({redirectTo: '/fotos'});
});