0

I'm trying to use ngFx library to play animation when a property changes on the scope. I've created a boilerplate code for directive:

angular.module('myApp')
.directive('zoomInOnChange', function () {
    return {
        restrict: 'A',
        scope: {
            param: "="
        },
        link: function (scope, element, attrs) {
            scope.$watch('param', function () {
                // ?
            });
        }
    }
});

and want to use it like this:

<h1 zoom-in-on-change param="{{someProp}}">{{someProp}}</h1>

Is there a way to trigger ngFx animations from inside the javascript code?

1 Answer 1

1

As it turned out, it's way simplier to implement animation working directly with TweenMax, which ngFx uses under the hood. That line of code solved my problem:

TweenLite.from(element, 0.5, {scale: 0, ease:Expo.easeIn});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.