Code Monkey home page Code Monkey logo

Comments (5)

45kb avatar 45kb commented on July 18, 2024

Ops, must be an oversight, thanks for spotting this out 👍

We will surely fix it asap, if you want to PR feel free.

from angular-fx.

cyrixmorten avatar cyrixmorten commented on July 18, 2024

Great :) impressively fast response.

Now that I have your attention, just wanted to point out that while looking through the source code, I noticed that your directives could be greatly simplified.

Taking wobble as an example:

.directive('ngfxWobble', [function directiveFunction() {
      return {
        'restrict': 'A',
        'link': function linkingFunction(scope, element, attributes) {
          var c = 'ngfx-wobble-start animated wobble'
            , fx = function fxFunction() {
              if (scope.$eval(attributes.ngfxWobble)) {
                element.removeClass('animated').addClass(c);
              } else {
                element.removeClass(c);
              }
           };

          scope.$watch(attributes.ngfxWobble, function watctherFunction() {
            fx();
          });
        }
      };
    }])

Could be simplified to:

.directive('ngfxWobble', [function directiveFunction() {
     return {
        'restrict': 'A',
        'link': function linkingFunction(scope, element, attributes) {
          scope.$watch(attributes.ngfxWobble, function watctherFunction() {
            element.toggleClass('ngfx-wobble-start animated wobble', scope.$eval(attributes.ngfxWobble));
          });
        }
      };
    }])

from angular-fx.

45kb avatar 45kb commented on July 18, 2024

@cyrixmorten Hi i've tested out and it seems that shake works great check here http://plnkr.co/edit/8oNRgSPbilO6WZhiTt1A?p=preview

Be sure to install latest version of the files better with bower or npm install.

As for the code suggestion, yes that would be really cool to slim it down, i will try to do all but if you want to make it feel free to PR it. 👍

Going to close the issue for the moment.

from angular-fx.

cyrixmorten avatar cyrixmorten commented on July 18, 2024

Alright, thank you for the response.

I might not have correctly included everything. However, I am pretty sure that my equivalent animate.css did not look like the one you supplied in your plnkr.

I will check back up on it monday or tuesday when I get back to my working PC.

Just for info, I installed your library through npm.

Regarding the slim-down refactor, I don't think it is that important or anything, was simply in case you had not noticed that 'shortcut' :)

from angular-fx.

cyrixmorten avatar cyrixmorten commented on July 18, 2024

Investigated the matter and found that I did not properly include animate.css.

Thank you again for taking the time to look at my issue and will definitely contribute if I find the time for it :)

from angular-fx.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.