javascript framework - value is undefined in emberjs nested view -


i have script handlebar..

<script id="owneritem" data-template-name='owneritem' type="text/x-handlebars">     {{value.username}} &nbsp;<button {{action "remove" on="click"}}>remove</button> </script>   

and view..

resadmin.ownerview = ember.view.extend({     templatename: 'owneritem',     remove: function() {       var selectedrest;       selectedrest = resadmin.admincontroller.get('selectedrestaurant');       alert(value.restaurantownerid);       return $.ajax({         url: '/api/restaurantowner/' + value.restaurantownerid,         cache: false,         type: 'delete',         data: {           restaurantid: selectedrest.restaurantid,           methodoverride: 'delete'         },         datatype: 'jsonp',         success: function(data) {           return resadmin.admincontroller.getrestaurantlist();         }       });     }   }); 

and in other view using view like

  {{#each resadmin.admincontroller.selectedrestaurant.owners}}             {{view resadmin.ownerview valuebinding="this" content="this"}}          {{/each}}  

but getting error(value not defined) when user click on remove button of nested view...can me ??

value property of ownerview need qualify this.get('value')

e.g.

this.get('value').restaurantownerid 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -