Note that there are some explanatory texts on larger screens.

plurals
  1. POPassing data from server block to client block and also calling 3rd party package in Meteor
    primarykey
    data
    text
    <p>I am not able to pass data from server block to client block . I am also not sure the way I call self created package is right or wrong . Here is my folder structure :</p> <pre><code>x/packages/me.js x/packages/package.js x/packages/smart.json x/x.css x/x.html x/x.js </code></pre> <p>Here is all code :</p> <p>me.js</p> <pre><code>Meteor.methods({ getTweets: function () { var key = "my api key"; var response = Meteor.http.call( "POST", "http://localhost:8000/users.json", { params: { appkey: key ,uid: "example" }}); return response.content; } }); </code></pre> <p>package.js</p> <pre><code>Package.describe({ summary: "summary etc" }); Package.on_use(function (api){ api.use(["http"],["server"]); api.add_files("me.js","server"); }); </code></pre> <p>smart.json</p> <pre><code>{ "name": "name example", "description": "desc", "homepage":"as", "author" : "xyz", "version" : "0.1", "packages": {} } </code></pre> <p>x.html</p> <pre><code>&lt;head&gt; &lt;title&gt;x&lt;/title&gt; &lt;/head&gt; &lt;body&gt; {{&gt; hello}} &lt;/body&gt; &lt;template name="hello"&gt; &lt;h1&gt;Hello World!&lt;/h1&gt; {{greeting}} &lt;input type="button" value="Click" /&gt; &lt;/template&gt; </code></pre> <p>x.js</p> <pre><code>if (Meteor.isClient) { Template.hello.greeting = function () { return "Welcome to y."; }; Template.hello.events({ 'click input' : function () { // template data, if any, is available in 'this' Meteor.call("hiren",function (err, data) { console.log(data); if(err) throw err; }); } }); } if (Meteor.isServer) { Meteor.call("getTweets",function (err, data) { Meteor.methods({ "hiren":function(){ return data; } }); }); } </code></pre> <p>When I click the "click" button , it just shows undefined</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload