Я вызываю простой google api, используя HTTP-метод на сервере. Кажется, я возвращаю объект json, но обратный вызов на клиенте, похоже, возвращает неопределенный объект.Метод Обратный звонок Возврат Неопределенный [CoffeeScript]
Моя догадка почему-то не доходит до обратного вызова во времени. Немного смущен.
Полный код здесь:
if Meteor.isClient
Meteor.startup() ->
console.log "Client Started."
Meteor.call("getGeocode", 94582, (error, result) ->
console.log "GeoCode returned to client, #{result}."
Session.set("latitude", result))
Template.results.latitude =() ->
Session.get("latitude")
Template.results.longitude =() ->
"longitude"
if Meteor.isServer
Meteor.startup() ->
console.log "Server Started"
Meteor.methods
"getGeocode": (zipCode) ->
result = HTTP.call("GET", "http://maps.googleapis.com/maps/api/geocode/json?address=#{zipCode}&sensor=false")
console.log "Geocode called, returning #{result}."
Спасибо! МНОГО очиститель. Отличные советы. Onward ... – ppedrazzi