This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<require from="./on-key"></require> | |
Press enter in textbox to trigger event: | |
<input | |
value.bind="message" | |
keyup.delegate="textEntered() & onKey:'enter'" | |
/> | |
${message} | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Validator{ | |
constructor(){ | |
this.violatedConstraints = 10; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<p>How to get selected checkbox values to array?</p> | |
<p>Follwoging <a href="http://aurelia.io/hub.html#/doc/article/aurelia/framework/latest/cheat-sheet/5" target="_blank">sample</a> isn't workign:</p> | |
<label repeat.for="color of colors"> | |
<input type="checkbox" value.bind="color" checked.bind="$parent.favoriteColors" /> | |
${color} | |
</label> | |
<p>PROBLEM: expecting array of selected values, not boolean: favoriteColors=${favoriteColors}</p> | |
</template> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div repeat.for="person of persons"> | |
<span with.bind="person" element.ref="el"> | |
${firstName} ${middleName} ${lastName} | |
</span> | |
</div> | |
app.el = ${el} <-- this (global el) should be null | |
<br/> | |
person[0].el = ${persons[0].el} | |
<br/> |