ember.js - How to remove the views while using the properties from the context of outerview in emberjs -
i have scenerio in wanted render properties in child view properties of parent view on basis of properties. when properties evaluates false view should destroyed giving error as: cannot call unchain of undefined , errors related this.
code:
template
<script type="text/x-handlebars"> <h2>welcome ember.js</h2> {{outlet}} </script> <script type="text/x-handlebars" data-template-name="address"> {{item.address.addressline1}}<br /> {{item.address.addressline2}}<br /> {{item.address.city}}, {{item.address.state}}<br /> </script> <script type="text/x-handlebars" data-template-name="index"> {{#if addressvisible}} <button {{action hideaddress}}> hide address </button> {{else}} <button {{action showaddress}}>show address</button> {{/if}} <ul> {{#each item in model}} <li> {{item.name}}<br /> {{#if addressvisible}} {{view app.addressview}} {{/if}} </li> {{/each}} </ul> </script>
i have created fiddle show issue: http://jsbin.com/inoroj/5/edit when click on showaddress shows address views when clicked on hide views should hide, instead raises unchain error.
it looks reason ember did not property being capitalized. changing address
address
app worked expected. made few other small changes well.
Comments
Post a Comment