meteor

How can I use NodeJS modules in Meteor?

北城以北 提交于 2020-01-05 08:42:21
问题 In a NodeJS application ,I have finished some modules,Now I want to use them in Meteor,What should I do? For example,there is a file 'hello.js',content: require('url');// In here,require other modules function sayHi(name){ console.log("Hi "+ name); } exports.sayHi = sayHi; How do I use 'say Hi' in meteor? when I do this: if (Meteor.isServer) { Meteor.startup(function () { var require = __meteor_bootstrap__.require; var index = require('./hello'); hello.syaHi('Ec');})} Errors is: app/index.js

Android WebView shows blank screen

╄→гoц情女王★ 提交于 2020-01-05 08:32:20
问题 I'm trying to create a WebView app that shows a meteor web app using Tiago Scolari's sample. When i load the apk in my phone i see the background changes but the log in button doesn't show. Anyone has a clue how to make this work? --Edit: Adding - webSettings.setJavaScriptCanOpenWindowsAutomatically(true); webSettings.setDomStorageEnabled(true); - shows me the log in button and gets me to the facebook log in. After logging in using facebook i'm presented with a white screen. Any more advice?

Fail to run laika framework for meteor

陌路散爱 提交于 2020-01-05 08:29:48
问题 I'm trying to run laika on my VM, but it still when I run the laika script, there is an error. Here is the error : nodejs [rebolon] /home/project/hello-laika % sudo laika injecting laika... loading phantomjs... loading initial app pool... /root/.meteor/tools/11f45b3996/lib/node_modules/fibers/fibers.js:13 throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-fibe ^ re-installing node-fibers... node-fibers reinstalled! run `laika` again! cleaning up injected code I installed

How do I iterate over an array of Strings with the Meteor Spacebars {{#each}} block?

喜你入骨 提交于 2020-01-05 08:25:19
问题 I have a Mongo.Collection that holds 'Question' objects. Each 'Question' has a property called choices Questions.insert({ text: 'What is the capitol of the US?', choices: [ "Washington D.C.", "Houston", "New York City", "Los Angeles" ], correctChoice: 0, date: new Date().toDateString() }); In my template I have this: <div class="question"> <div class="question-content"> <p>{{text}}</p> <ul> {{#each choices}} //????????? {{/each}} </ul> </div> </div> What should I put instead of the question

Accounts.registerLoginHandler with passwords in Meteor

久未见 提交于 2020-01-05 08:18:14
问题 I'm new to meteor and am stuck on registering a login handler that lets me use the password to authenticate the user. I'm working off the code from http://meteorhacks.com The server side code is as follows: Accounts.registerLoginHandler(function(loginRequest) { var userId = null; var user = Meteor.users.findOne({'emails.address': loginRequest.email, password: loginRequest.password, 'proile.type': loginRequest.type}); if(user) { userId = user._id; } return { id: userId} This works fine if I

How to implement a selector in easy: search for Meteor, using React instead of Blaze

社会主义新天地 提交于 2020-01-05 08:11:06
问题 I'm trying to follow the documentation and examples to add a server-side selector to a search function in my Meteor app, implemented using the Easy Search plugin. The end goal is to ensure that only documents the user has permission to see are returned by searching. I can see a selector working in the Leaderboard example, but I can't get it to work in my code. Versions: Meteor 1.7.0.1 easy:search@2.2.1 easysearch:components@2.2.2 easysearch:core@2.2.2 I modified the Meteor 'todos' example app

How to implement a selector in easy: search for Meteor, using React instead of Blaze

空扰寡人 提交于 2020-01-05 08:11:05
问题 I'm trying to follow the documentation and examples to add a server-side selector to a search function in my Meteor app, implemented using the Easy Search plugin. The end goal is to ensure that only documents the user has permission to see are returned by searching. I can see a selector working in the Leaderboard example, but I can't get it to work in my code. Versions: Meteor 1.7.0.1 easy:search@2.2.1 easysearch:components@2.2.2 easysearch:core@2.2.2 I modified the Meteor 'todos' example app

Can i get the template parent data context in the event function?

我与影子孤独终老i 提交于 2020-01-05 07:46:30
问题 I'd love to get my hands on a templates data context. Can I do something like this? 'click .newContext': function(event, template) { var template_parent = template.parent(); var parent_data = template_parent.data; } 回答1: You can use Template.parentData(0) , the argument defines how deep you want to go, if you pass none, 0 is the default. Check the documentation on this: http://docs.meteor.com/#/full/template_currentdata 回答2: Yeah, if you're trying to get the parent's data context you should

Meteor on Heroku Deployment

二次信任 提交于 2020-01-05 07:40:32
问题 I am trying to deploy Meteor to a remote Heroku server. I am following this tutorial, but get errors. Any advise would be appreciated please. When I do the git push heroku master : However, the server logs: 2016-09-11T18:03:14.757898+00:00 heroku[slug-compiler]: Slug compilation started 2016-09-11T18:03:14.757903+00:00 heroku[slug-compiler]: Slug compilation finished 2016-09-11T18:03:41.646676+00:00 heroku[web.1]: Starting process with command `node build/bundle/main.js` 2016-09-11T18:03:44

Meteor: Uncaught RangeError: Maximum call stack size exceeded

让人想犯罪 __ 提交于 2020-01-05 05:29:09
问题 I am very new to Meteor. I am doing simple app. Here is the problem I have: Template.newFeedForm.events({ 'submit #new-feed-form'(event) { event.preventDefault(); const target = event.target; const text = target.text; Meteor.call('feeds.insert', text); target.text.value = ''; } }); So I have newFeedForm template and in my feeds.js I have Meteor.methods({ 'feeds.insert'(text){ check(text, String); //check(hashtag, String); // Make sure the user is logged in before inserting a task if (! this