Quantcast
Channel: Ember.JS - Latest topics
Viewing all articles
Browse latest Browse all 4829

Use conditional helpers

$
0
0

@belgoros wrote:

I tried to use an if helper as follows:

{{#if existingDaysIds.includes(weekday.id)}}
    <p>includes</p>
{{/if}}

and it failed:

emplate Compiler Error (TemplateCompiler) in .../templates/working-hours.hbs

Parse error on line 6:
...#if existingDaysIds.includes(1)}}      
-----------------------^
Expecting 'ID', got 'INVALID'

When I display existingDaysIds array:

<p>{{existingDaysIds}}</p>

it displays the number I’d like to check:

0,1,2,3,4,5,6

What’s wrong with that ?

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4829

Trending Articles