ng-image-appear-不工作

时间:2016-08-09 11:34:14

标签: javascript angularjs twitter-bootstrap

我通过以下链接...

AngularJS Module to make images appear with transition as they load.

codepen link

我在我的应用程序中使用它但没有获得tranisition和动画效果

HTML:

<div ng-app="myApp">
  <div ng-controller="myCtrl">
    <img class="img1" src="https://newevolutiondesigns.com/images/freebies/tropical-beach-background-8.jpg" ng-image-appear responsive transition-duration="1s" animation="fadeInUp" animation-duration="1s" easing="ease-out" />
  </div>
</div>

角:

var myApp = angular.module('myApp', ['ngImageAppear']);

myApp.controller('myCtrl', ['$scope', function($scope) {

}]);

CSS:

body {
  background-color: #aaa;
}

.img1 {
  width: 60%;
  height: auto;
}

.img2 {
  width: 70px;
  height: auto;
}

.img3 {
  width: 450px;
  height: auto;
}

.loader-class {
  background-color: rgba(255, 255, 255, .65);
}

.placeholder-class {
  background-size: contain;
}

1 个答案:

答案 0 :(得分:0)

您需要添加对项目的引用,

namespace AppBundle\Repository;

class ConfigRepository extends \Doctrine\ORM\EntityRepository
{
    public function getconfig( $config_name )
    {
        $config = $this->getEntityManager()
        ->createQuery('SELECT p.config_value FROM AppBundle:Config p WHERE p.config_name = :config_name')
        ->setParameter('config_name', $config_name)
        ->getResult();
        if (sizeof($config)){
            return $config[0]['config_value'];
        }else{
            return false;
        }
    }