问题
I'm building a polymer app that submits to a REST api and I've got all that up and running. But now I'm trying to add some simple validation to it and I can't figure out how to validate the paper-radio inputs. I just want to use HTML5 validation - but that may not be possible. The only thing is that I cannot use jQuery - its not an option for the project's parameters. Does anyone know how to validate the basic structure I'm using? (see below)
<paper-radio-group selected="{{selected}}">
<paper-radio-button class="radio" value="{{value}}" name="{{name}}" label="{{label}}"></paper-radio-button>
<paper-radio-button class="radio" value="{{value}}" name="{{name}}" label="{{label}}"></paper-radio-button>
<paper-radio-button class="radio" value="{{value}}" name="{{name}}" label="{{label}}"></paper-radio-button>
</paper-radio-group>
Thanks!
回答1:
Here's a recent article on 'Unit Testing Polymer Elements'
https://www.polymer-project.org/articles/unit-testing-elements.html
来源:https://stackoverflow.com/questions/27259897/validating-polymer-paper-elements