ember.js - Action Helper in Ember JS not calling function -
<a class="btn btn-primary" href="#" {{action "togglestatus"}}><i class="icon-plus icon-white"></i> add staff</a>
this in view template called stafflist.handlebars. content follows
<div class="page-header"> <h3>{{staff.title}} <small>list of users has access application</small></h3> </div> <div class="commands pull-right"> sta <a class="btn btn-primary" href="#" {{action "togglestatus"}}><i class="icon-user icon-white"></i> {{staff.btntitle}}</a> </div> <div class="pull-left"> <input type="text" class="search-query" placeholder="search"> </div> <table class="table table-striped table-bordered"> <thead> <tr> <td>name</td> <td>id</td> </tr> <thead> <tbody> {{#each staff}} <tr> <td>{{this.fname}}</td> <td>{{this.id}}</td> </tr> {{/each}} </tbody> </table>
the view file below
app.stafflistview = em.view.extend({ templatename:'sellap-web/~templates/stafflist', staffbinding:'app.staffcontroller', togglestatus: function() { alert('hurray'); } });
when clicking button, action never calling alert. going wrong here. using ember-skeleton compile.
found culprit. app.create has method called init. changed name else , works fine. didnt call super.
Comments
Post a Comment