Hi everybody,
Here is my situation, I am using Sane Stack a CLI that works with Eember.js and Sails.js, I am creating a web application that interacts with the JIRA REST Api, here is a scheme to illustrate what I am trying to explain :
As the shown in the scheme above, the architecture of my web application is as follows, my Sails backend communicate with external API and retrieve data from it (e.g. Jira API) and I want my Ember client to get this data from Sails.
Indeed, I can get my JSON from the external API Sails side, in my browser I can display the retrieved JSON with this URL: http://127.0.0.1:1337/projects.
In the Ember side, I tried to get this JSON in my project-view component:
import Ember from 'ember';
export default Ember.Component.extend({
model(){
console.log("here we go !");
return Ember.$.getJSON('http://127.0.0.1:1337/api/v1/projects');
}
});
But it returns nothing (Checked with the Ember Inspector), Am I doing it wrong ? can someone help me please ?
I don’t have a lot of experience with SANE stack but I do think that it uses Ember Data by default, and therefore it might be useful to set up a project model with the relevant attributes. See the Model Guides.
Then you could use this.store.find('project') in place of getJSON.