Currently Im trying to use a function that observes a field of a controller/component in ember template (handlebars).
index.hbs
<span>This field is required</span>
index.js
hasFieldError: function(val) {
return true if val is found in an array
}.observes('field1'),
But this of course returns a build error:
{#if hasFieldError('compa ----------------------^ Expecting
'CLOSE_RAW_BLOCK', 'CLOSE', 'CLOSE_UNESCAPED', 'OPEN_SEXPR',
'CLOSE_SEXPR', 'ID', 'OPEN_BLOCK_PARAMS', 'STRING', 'NUMBER',
'BOOLEAN', 'UNDEFINED', 'NULL', 'DATA', 'SEP', got 'INVALID'
Any idea how to achieve this?
Aucun commentaire:
Enregistrer un commentaire