ember.js - #if statement throws TypeError: node is undefined -
consider below snippet in handlebar written ember.js:
<script type="text/x-handlebars" id="courses/selectedcourse"> <div id="selectedcourse"> {{#if isregistered}} <div class="xx"> registered course </div> {{else}} <div class="yy"> <button {{action registerforcourse}}>register</button> </div> {{/if}} <h1>{{coursetitle}}</h1> <div class="selectedcourseitem"> <img id="selectedcourse" {{bindattr src="imageurl"}}/> </div> </div> </script>
issue1 : content not getting refreshed after registering course.
issue2 : on changing selected courses couple of times, content displayed twice , overlapping.
following message see in firebug:
typeerror: node undefined
[break on error]
node.unchain(key, path);
if remove #if
statement, works well.
what doing wrong?
i had similar issue , fixed making first letter of argument in if statement lower case
{{#if isregistered}}
Comments
Post a Comment