jeudi 29 octobre 2015

Handlebars not rendering based on js code

In my Ember app, I have the following code in my Handlebars template (partial code)

<input type="radio" class="warningActionExcl" name="warningAction_{{warningDetails.someId}}" {{action 'warningActionClicked'}} data-someId="{{warningDetails.someId}}" />   

Also in the corresponding controller class, I have

var isExclude = $(event.target).attr('class');
if (isExclude == "warningActionExcl") {
    //do something
} 

Now the template renders properly with the above. But if I update my template code as (i.e. mismatched class name with what the JS is checking for..warningAction V/s warningActionExcl)

class="warningAction"

the template does not render entirely. But it does not give any Javascript error.

I am not sure why this is the case, as I thought there is no checking with JS code while rendering the template.

Please suggest.




Aucun commentaire:

Enregistrer un commentaire