Advertisement
Guest User

Untitled

a guest
Jan 28th, 2015
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. riot.tag('boolean-attrs', '<p><code>riot.version: {opts.version}</code></p> <p>Try using the toggle button before and after clicking on the checkboxes.</p> <p><code>bool: {String(this.bool)}</code></p> <label><input type="checkbox" __checked="{this.bool}"> <code>checked=\\{this.bool\\}</code></label> <br> <label><input type="checkbox" __checked="{!this.bool}"> <code>checked=\\{!this.bool\\}</code></label> <br> <button type="button" onclick="{toggleBool}">Toggle <code>bool</code></button>', function(opts) {
  2.  
  3. this.bool = false
  4.  
  5. this.toggleBool = function() {
  6. this.bool = !this.bool
  7. }.bind(this);
  8.  
  9. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement