lundi 18 décembre 2017

Ember Handlebars Get helper won't accept words with hyphens

This question builds off of Get helper in hbs when getting nested object where I have a nested data object. Problem is that the Ember Handlebars 'get' helper does not work with strings that contain hyphens as a parameter and I am unsure why.

Here is how I'm templating this out:

<h3>The selected office:</h3>
<h4></h4>
<h3>The concat thing</h3>
<h4></h4>
<h3>The amazing title:</h3>
<h4></h4>

Here, the selected office comes from a select menu and populates, and so does the concatination string below.

When there is no hyphen in the selectedOffice variable, the specialthing will populate as well.

But when there is a hyphen such as "Kitchener-Waterloo", the specialThing will not populate.

The data structure I am working with is similar to:

"funnelContent": {
    "City": {
        "testing_attribute": Hello City!",
        "one_number": 0,
        "other_number": 0
    },
    "Other City": {
        "testing_attribute": Hello Other City!",
        "one_number": 0,
        "other_number": 0
    },
   "Kitchener-Waterloo": {
        "testing_attribute": Hello Kitchener-Waterloo!",
         "one_number": 0,
         "other_number": 0
    }
}




Aucun commentaire:

Enregistrer un commentaire