Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to bind tap event on chilren node #278

Closed
icode opened this issue Sep 14, 2013 · 2 comments
Closed

how to bind tap event on chilren node #278

icode opened this issue Sep 14, 2013 · 2 comments

Comments

@icode
Copy link

icode commented Sep 14, 2013

    <polymer-element name="ui-reports">
    <template>
        <template if="{{reportsDetails&&reportsDetails.reports}}">
            <ul>
                <template repeat="{{item in reportsDetails.reports}}">
                    <li on-tap="reportTap" doc-id="{{item.OBJID}}"></li>
                </template>
           </ul>
      </template>
      <script>
        Polymer('ui-reports', {
            reportsDetails       : null,
            reportTap            : function (e) {
                if (e.path) {
                    var self = this;
                    e.path.forEach(function (item) {
                        if (item.getAttribute) {
                            var docId = item.getAttribute('doc-id');
                            if (docId) {
                                self.fire('report-tap', {docId: docId});
                                return false;
                            }
                        }
                    });
                }
            }
        });
    </script>
    </polymer-element>

I write with this.I don't know how to get li element

@sjmiles
Copy link
Contributor

sjmiles commented Sep 14, 2013

I believe what you are looking for is this:

            reportTap: function (e, detail, sender) {
                this.fire('report-tap', {docId: sender.getAttribute('doc-id')});
            }

@icode
Copy link
Author

icode commented Sep 15, 2013

thank,docment is a lite ... Can not be compared with angularjs

@icode icode closed this as completed Sep 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants