Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Ajax responseChanged return logged twice #43

Closed
ebidel opened this issue Nov 9, 2014 · 1 comment
Closed

Ajax responseChanged return logged twice #43

ebidel opened this issue Nov 9, 2014 · 1 comment

Comments

@ebidel
Copy link
Contributor

ebidel commented Nov 9, 2014

From @alitavector on November 9, 2014 19:22

From the chrome dev tool, it seem to log output the "test" message twice each times the submit button is press.

...
<core-ajax id="ajax" method="POST" url="r.php" params="{{item}}" response="{{response}}"></core-ajax>
    <template repeat="{{response}}">{{data}}</template>
    {{response}}
    <br>
  </template>
  <script>
    Polymer('add-node', {
      created: function() {
        this.item = {};
      },
      doSend: function() {
        this.$.ajax.go();
      },
      responseChanged: function() {
        console.log("test");
      }
    });
  </script>

Copied from original issue: Polymer/polymer#900

@garlicnation
Copy link
Contributor

Working as intended. The response changes twice every time a request is sent, first to null, then to the value of the response, to prevent stale data from propagating through the model.

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

No branches or pull requests

2 participants