1

問題は、カスタム JavaScript アニメーションを使用する requireJS および ngAnimate に関する問題です。主に setup メソッドと start メソッドは呼び出されません。ファイルがrequireJS経由でロードされていることを確認できますが、アニメーションは起動されません。すべての指示に従っているにもかかわらず、自分のコードが間違っていると思い始めています。誰かが RequireJS の実装を投稿できますか? または私のエラーを指摘しますか?

define(['angular'],
function (angular) {
    var animations = angular.module('animations', []);
    animations.animation('js-animation', function () {
        return {
            setup: function (myElement){
                console.log('we are in here');
                myElement.hide();
                $('.unpublish, .good, .delete').fadeOut('slow');
            },
            start: function (myElement, done) {
              console.log('we are in the start');
            },
            cancel : function(element, done) {

                done();
            }
        }
    });
    return animations;
});

アニメーションを実行する方法は次のようになると思います

    <ul>
    <li ng-animate="{enter: 'js-animation'}" ng-repeat="gallery in galleries">
        {{ gallery.name }}
    </li>
</ul>

アニメーションの宣言が不適切ですか、それともこのコードに何か問題がありますか?

4

0 に答える 0