шаблона помощник:JSON объект. Не удается получить данные в шаблоне. Метеор
Template.userLoggedIn.helpers({
stream: function() {
return ReactiveMethod.call("checkApi", function(err, results) {
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'); //nothing
res = JSON.parse(results.content); // nothing
return res
});
}
В моем шаблоне:
{{#with stream }}
{{this}} //Object object
{{/with}}
Если я пытаюсь:
{{#with stream }}
{{this.livestream}} //Undefined
{{/with}}
Мой Meteor.Method:
Meteor.methods({
checkApi: function() {
this.unblock();
re = Meteor.http.call("GET", "http://api.hitbox.tv/media/live/uccleague")
return re;
}
});
Как я n получить доступ к этому объекту json? Возвращения метода вызова (JSON) здесь: http://www.jsoneditoronline.org/?id=1ae1eaaf7a4e942bd4a0728517b10779