Skip to content

Instantly share code, notes, and snippets.

@justinvdm
Created September 20, 2016 05:58
Show Gist options
  • Save justinvdm/bce6275faf5c1fa930fdf732f87c54fa to your computer and use it in GitHub Desktop.
Save justinvdm/bce6275faf5c1fa930fdf732f87c54fa to your computer and use it in GitHub Desktop.
function validate(fields) {
return {
username: [{
type: 'contains_invalid_chars',
payload: {
badChars: '@'
}
}, {
type: 'some_other_error'.
payload: {
// ...
}
}]
};
}
<input name="username">
{# username }
{# type === 'contan' }
Bad because <strong>{{badChars}}</strong>
{/}
{/username}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment