vendredi 7 février 2020

how to do a store.query or AJAX call in a helper (ember.js)

I'm building a profile web using ember.js and CodeIgniter (PHP) as the backend framework, I'd like to make a helper to get my web configurations stored in Back-end database in key-value manner.

enter image description here

I have the API ready in the backend to get the configuration (localhost/api/get_config) an ajax call to

localhost/api/get_config&key=phone will return a string of "123123123"

and a call to

localhost/api/get_config&key=address will return a string of "Testing ave 102"

How to make a helper to get the values based on the key provided. for example will return 123123123.

If possible, I would also like to use the namespace and host configuration in application's adapter to do the query or make the ajax call. now my adapter config are

export default JSONAPIAdapter.extend({
    host: "http://localhost",
    namespace: 'api'
});



Aucun commentaire:

Enregistrer un commentaire