Files
ember-cli-dunlop/app/templates/components/validated-input.emblem
T
2017-12-21 11:42:41 +01:00

13 lines
513 B
Plaintext

/ based on https://www.emberscreencasts.com/posts/172-displaying-errors-inline-with-ember-changeset-validations
if label
label= label
else
if labelPath
label= t labelPath
one-way-input value=(get changeset attribute) update=(action (mut (get changeset attribute))) onblur=(action 'validateProperty' changeset attribute) disabled=disabled onenter='inputEnter'
if (get changeset.error attribute)
each (get (get changeset.error attribute) 'validation') as |error|
.ui.pointing.red.basic.label= error