lundi 9 janvier 2017

How to access the params in controller ember.js

This is my router.js code.

this.route('contact',{'path': '/contact/:chat_id'});

and This is my route.js code.

 model(params) {

return this.store.findRecord("chat", params.chat_id)
 },

and This is my controller.js code and can i use like this. It shows error please help me. How to use params in controller

recordChat: function() {

  var chat = this.get(params.chat_id)

    Ember.RSVP.hash({

    offer_id: chat,
    })
   },




Aucun commentaire:

Enregistrer un commentaire