I try to send model in post request. How to do it?

import Ember from 'ember'; export default Ember.Controller.extend({ pageBinding: "content.page", perPageBinding: "content.perPage", totalPagesBinding: "content.totalPages" actions: { excelDownoload: function(user) { $.ajax({ type: "POST", url: "http://list-share-shop.loc/app_dev.php/admin-api/v1/excel.json", data: model(param) }); }, } }); 

I do like this

so

 <button class="btn btn-violet" {{action "excelDownoload"}}>Generate report</button> 

and in response model not defined

    2 answers 2

    Few information was provided. Is there a link to the repository? What is param in model (param)?

    Generally it is not recommended to use controllers. They are also refused.

    • I am rewriting a ready-made project on EmberJS and I don’t understand what and how .... bitbucket.org/sspsoft/lss-admin - Nikita Rassamahin
    • No access to repository - Alex Bond

    That's right, the model() function does not exist. It is undefined in the file and in the scope ... do so

     $.ajax({ type: "........", url: "...........", data: { "ключ":значение......, "ключ":значение......, "ключ":значение......, "ключ":значение...... } });