Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

docs(guide/Animations): describe your change... #14900

Closed
wants to merge 2 commits into from

Conversation

Deklin
Copy link
Contributor

@Deklin Deklin commented Jul 12, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

Doc update

What is the current behavior? (You can also link to an open issue here)

Incorrect doc

What is the new behavior (if this is a feature change)?

Matches $animate documentation

Does this PR introduce a breaking change?

Fixes user confusion.

Please check if the PR fulfills these requirements

Other information:

The documentation for $animate lists it as element, boolean, this guide was showing boolean, element.

https://code.angularjs.org/1.4.9/docs/api/ng/service/$animate

The documentation for $animate lists it as element, boolean, this guide was showing boolean, element.

https://code.angularjs.org/1.4.9/docs/api/ng/service/$animate
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

1 similar comment
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@Deklin
Copy link
Contributor Author

Deklin commented Jul 12, 2016

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

1 similar comment
@googlebot
Copy link

CLAs look good, thanks!

Changed preceding sentence to match.
@gkalpak gkalpak closed this in c253b8e Jul 12, 2016
@Deklin
Copy link
Contributor Author

Deklin commented Jul 12, 2016

@gkalpak the documentation states this:

enabled([element], [enabled]);
Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This function can be called in four ways:

// returns true or false
$animate.enabled();

// changes the enabled state for all animations
$animate.enabled(false);
$animate.enabled(true);

// returns true or false if animations are enabled for an element
$animate.enabled(element);

// changes the enabled state for an element and its children
$animate.enabled(element, true);
$animate.enabled(element, false);

However this guide was showing it as
$animate.enabled(true, element);

Which is correct then?

gkalpak pushed a commit that referenced this pull request Jul 12, 2016
@gkalpak
Copy link
Member

gkalpak commented Jul 12, 2016

The documentation 😃
(And now the guide too, thanks to you 😛 )

@Deklin
Copy link
Contributor Author

Deklin commented Jul 12, 2016

@gkalpak also the code clearly takes element then bool, so i'm confused why you don't think this PR is valid. This is my first PR to angular, so I apologize if I am missing something here, but please advise so I can help contribute more effectively in the future.

From angular-animate.js

// this method has four signatures:
      //  () - global getter
      //  (bool) - global setter
      //  (element) - element getter
      //  (element, bool) - element setter<F37>
      enabled: function(element, bool) {
        var argCount = arguments.length;

        if (argCount === 0) {
          // () - Global getter
          bool = !!animationsEnabled;
        } else {
          var hasElement = isElement(element);

          if (!hasElement) {
            // (bool) - Global setter
            bool = animationsEnabled = !!element;
          } else {
            var node = getDomNode(element);
            var recordExists = disabledElementsLookup.get(node);

            if (argCount === 1) {
              // (element) - Element getter
              bool = !recordExists;
            } else {
              // (element, bool) - Element setter
              disabledElementsLookup.put(node, !bool);
            }
          }
        }

        return bool;
      }
    };

@gkalpak
Copy link
Member

gkalpak commented Jul 12, 2016

The PR is fine. I tweaked the commit message a bit and merged 😄
You are a contributor now (and we really appreciate it): c253b8e 👍

You are probably confused by the fact we don't use a "git-merge" workflow (so GitHub doesn't display the "Merged" badge). We prefer to keep a more linear history by using git-rebase (which in GitHub appears as "Closed").

@Deklin
Copy link
Contributor Author

Deklin commented Jul 12, 2016

@gkalpak thanks for your patience with me and guidance here. Much appreciated! Thanks for you and your teams hard work on Angular!

@Deklin
Copy link
Contributor Author

Deklin commented Jul 12, 2016

@gkalpak yes I was confused by closed vs merge as well, thanks for the clarification

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants