1

My understanding is that if a given route in an Ember app needs to grab data from the server to feed its model, we will either use Ember data with a RESTful API or just an AJAX request, and the request for model data will come from the Ember app to the server.

But what if I want the server itself, at the end of a server-side process, to ask the Ember app to display one of its routes by passing to it some data to be used as the route model?

Basically, a process on the Node-based server (with Express) ends up like so:

function(req,res) {
    res.redirect("/#/someEmberAppRoute");
}

The req parameter carries some object that I want to pass to the Ember route in order to be used as a model for that route.

4

1 回答 1

0

我最终解决此问题的方法是将服务器端进程的输出存储在服务器上,并让 Ember 路由 someEmberAppRoute 的模型向服务器发送 GET 请求以获取该输出并提供其模型,而不是尝试推送它直接从服务器到客户端。

于 2013-10-04T17:26:56.613 回答