Here is my code:
App.TopWeatherComponent = Em.Component.extend({
info: function() {
return $.getJSON('http://192.168.1.39:3000/term_api/get_weather?callback=?').then(function(data) {
return data;
});
}.property()
});
And the following is my component:
<div>{{info}}</div>
But when I see the page which there is a top-weather component, {{info}} represents the promise object instead of the data I want. So how could I get the correct data? I want the data returned by the success function in the then. If the code above is not the right way, then what is the right way? Thanks a lot