jeudi 6 octobre 2016

send action is not working for component

send action is not working for component. when using component inside view and sending action from component to view.

confirm-dailog.js

    import Ember from 'ember';
    export default Ember.Component.extend({
    actions:{
       closeConfirmDialog:function(){
          this.sendAction('onCancel');
       }
   }

})

confirm-dailog.hbs

<div class="dialog" id="dialog">
   <div class="button">Cancel</div>
</div>

modal.js

import Ember from 'ember';
export default Ember.View.extend({
   layoutName: 'components/modal-box',
   actions:
   {
       closeDialog:function()
        {   
            console.log('called model closedialog')
        },
   }
})

modal-box.hbs

<div class="dialog" id="dialog">
    
    
</div>

when i am clicking on cancel button closeConfirmDialog action gets called and from there i am trying to send closeDialog action but its showing error Nothing handled the action 'closeDialog'




Aucun commentaire:

Enregistrer un commentaire