Name: inject-data
Owner: meteorhacks
Description: A way to inject data to the client with initial HTML
Created: 2015-01-21 12:01:14.0
Updated: 2017-09-03 12:34:33.0
Pushed: 2016-12-12 14:04:28.0
Homepage: null
Size: 17
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is the package used by fast-render
to push data to the client with the initial HTML.
meteor add meteorhacks:inject-data
We need to use this package with a server side router. We've extended nodejs http.OutgoingMessage
and provides an API like this.
Here is an example with picker.
er.route("/", function(params, req, res, next) {
r ejsonData = {aa: 10};
jectData.pushData(res, "some-key", ejsonData);
make sure to move the routing forward.
xt();
You can get data with the following API from the client.
ctData.getData("some-key", function(data) {
nsole.log(data);