Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

A transição não funcion, em nenhum navegadore.

Conforme o código abaixo está de acordo com o curso, mas a minha transição não funciona, por quê?

Controller

angular.module('alurapic').controller('FotosController', function($scope, $http) {

  $scope.fotos = [];
  $scope.filtro = '';

  $http.get('v1/fotos').success(function(fotos){
    $scope.fotos = fotos;
  }).catch(function(error){
    console.log(error);
  });

index.html

<!DOCTYPE html>
<html lang="pt-br" ng-app="alurapic">
    <head>
      <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/main.js"></script>
          <script src="js/controllers/fotos-controller.js"></script>
      <script src="js/directives/minhas-diretivas.js"></script>
    </head>
    <body ng-controller="FotosController">
      <div class="container">

          <div class="jumbotron">
            <h1 class="text-center">Alurapic</h1>
          </div>

          <div class="row">
            <div class="col-md-12">
              <form>
                <input ng-model="filtro" ng-model-options="{debounce: 600}" class="form-control" placeholder="Filtrar">
              </form>
            </div>
          </div>

          <div class="row">
            <meu-painel class="col-md-2 painel-animado" ng-repeat="foto in fotos | filter: filtro" titulo="{{foto.titulo}}">
                <img class="img-responsive center-block" src="{{foto.url}}" alt="{{foto.titulo}}">
            </meu-painel> <!-- fim panel -->
          </div>
      </div> <!-- fim container -->
    </body>
</html>



CSS

 .painel-animado.ng-leave-active {
  -moz-transform: scale(0.1);
  -webkit-transform: scale(0.1);
  -ms-transform: scale(0.1);
  -o-transform: scale(0.1);
  transform: scale(0.1);
}

.painel-animado {
   -moz-transition:transform 0.8s;
   -webkit-transition:transform 0.8s;
   -ms-transition:transform 0.8s;
   -o-transition:transform 0.8s;
   transition:transform 0.8s;
}
2 respostas

Vi que faltava o ngAnimate no módulo principal, mas quando o coloco o erro abaixo acontece:

Error: [$injector:modulerr] http://errors.angularjs.org/1.3.15/$injector/modulerr?p0=alurapic&p1=%5B%24injector%3Amodulerr%5D%20http%3A%2F%2Ferrors.angularjs.org%2F1.3.15%2F%24injector%2Fmodulerr%3Fp0%3DngAnimate%26p1%3D%255B%2524injector%253Anomod%255D%2520http%253A%252F%252Ferrors.angularjs.org%252F1.3.15%252F%2524injector%252Fnomod%253Fp0%253DngAnimate%250AR%252F%253C%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A6%253A417%250AOd%252F%253C%252F%253C%252F%253C%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A21%253A412%250Aa%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A21%253A53%250AOd%252F%253C%252F%253C%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A21%253A1%250Ag%252F%253C%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A35%253A46%250Ar%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A7%253A300%250Ag%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A34%253A399%250Ag%252F%253C%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A35%253A63%250Ar%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A7%253A300%250Ag%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A34%253A399%250Aab%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A38%253A135%250Auc%252Fd%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A17%253A381%250Auc%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A18%253A179%250AJd%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A17%253A1%250A%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A250%253A429%250Aa%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A164%253A283%250Alf%252Fc%2540http%253A%252F%252Flocalhost%253A3000%252Fjs%252Flib%252Fangular.min.js%253A32%253A384%250A%0AR%2F%3C%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A6%3A417%0Ag%2F%3C%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A35%3A320%0Ar%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A7%3A300%0Ag%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A34%3A399%0Ag%2F%3C%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A35%3A63%0Ar%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A7%3A300%0Ag%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A34%3A399%0Aab%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A38%3A135%0Auc%2Fd%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A17%3A381%0Auc%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A18%3A179%0AJd%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A17%3A1%0A%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A250%3A429%0Aa%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A164%3A283%0Alf%2Fc%40http%3A%2F%2Flocalhost%3A3000%2Fjs%2Flib%2Fangular.min.js%3A32%3A384%0A angular.min.js:6:416

solução!

Por algum motivo não estava importando o arquivo angular-animate.min.js, depois de muito trabalho ele simplesmente importou e funcionou. O Angular às vezes tem uns bugs como esse, acho que deve ser cache do navegador ou algo parecido.