mardi 27 octobre 2015

Can not send same action from different components

I have two components which should send action to controller, but only one of them does work

My controller:

`import Ember from "ember"`

CourseIndexController = Ember.ObjectController.extend
  actions:
    openStep: (unit, step, routeName)->
        @transitionToRoute(routeName, unit, {queryParams: {scope: step}})
`export default CourseIndexController`

And my components:

UnitTableStateComponent = Ember.Component.extend  
  step: ''
  unit: ''

  openStep:( ->
    @sendAction('action', @get('unit.id'), @get('step'), 'unit')

  ).on('click') //it works
`export default UnitTableStateComponent;`


ExamTableStateComponent = Ember.Component.extend
  exam: ''
  step: ''
  openStep:( ->
    @sendAction('action', @get('exam.id'), @get('step'), 'exam')

  ).on('click') //id does not works
`export default ExamTableStateComponent;`

I can not understand what's wrong with ExamTabeStateComponent or with whole my code

ember version: 1.13.8




Aucun commentaire:

Enregistrer un commentaire