dimanche 3 janvier 2016

The Emberjs unable to set the model inside the promise after calling ajax call

`import Ember from 'ember'`
ProjectsController = Ember.Controller.extend
  ajax:Ember.inject.service()
  actions:
    searchProject:(pid)->
      promise  = @get "ajax"
        .request "/projects/search/#{pid}"
      promise.then (data)->
        @set 'model',data
`export default ProjectsController`

I am calling searchProject action from the hbs file.I'm trying here to set the model inside the then function of promiss but i'm unable to do that the html in this view has to refresh with the data from the promise ajax is working fine data is returning fine i have to set this data as the model enter image description here




Aucun commentaire:

Enregistrer un commentaire