meteor

MeteorJS: Get success callback from user update?

一笑奈何 提交于 2019-12-25 07:47:03
问题 So, I just want to know if my user update was successful on client, so I can notify the user that the update worked. //Client Side return Meteor.call('handleUpdateUser', _id, _username, function(err, res) { if (err) { // also, what is best practices for handling these errors? } console.log(res); }); //Server Side Meteor.methods({ handleUpdateUser(id, username) { if (check for user...) { return if found } return Meteor.users.update({_id: id}, {$set: {username: username}}, function(err, count,

Correct way to disable multiple Textarea / checkbox depends on the dropdown box's Value

♀尐吖头ヾ 提交于 2019-12-25 07:40:50
问题 I'm looking for an effective way to enable / disable multiple controls (textarea, checkbox) through dropbox. I.e. Selecting item A in dropbox will disable certain controls, while selecting item B in dropbox will disable some other controls. Codes on how I approach with disabling textbox: HTML: <template name="Gender"> <input disabled={{shouldBeDisabled}} class="input" type="text"/> </template> <template name="DoB"> <textarea rows="3" cols="27" disabled={{shouldBeDisabled}}>purpose</textarea>

how to make Meteor.user field reactive

感情迁移 提交于 2019-12-25 07:40:16
问题 I am trying to block user who open more than one browser being logged In. I have a Meteor.user() object populated as follows when a user signs up: { "_id" : "uSS2RqZnnFwui67wk", "createdAt" : ISODate("2017-05-15T07:28:10.546Z"), "services" : { "password" : { "bcrypt" : "$2a$10$DPgA59Gmob4ajzjYZyh5auoHRUyQuF1/7M0KaWz.nzW0mIEqzlDK6" }, "resume" : { "loginTokens" : [ { "when" : ISODate("2017-05-15T13:42:29.322Z"), "hashedToken" : "tkoQnweSQhgRKGzaJTAkUU3/Ljd3p4wrBJfrRvRRlcY=" } ] } }, "username"

mjpg link not rendering on mobile app when built using Meteor

余生颓废 提交于 2019-12-25 07:40:00
问题 I am currently trying to get a multi-image url to render in my app. It works when I am testing it out in the url, but when I deploy it on my android device it doesn't render at all. It shows that no image found icon. I am able to successfully build it using Meteor and having Cordova build the mobile version for me. Here is the url I am trying out for example. <img src="http://193.85.239.147:86/mjpg/video.mjpg?COUNTER"> What I am particularly looking for is some sort of work around that could

meteor Roles.userIsInRole() always returning false

六月ゝ 毕业季﹏ 提交于 2019-12-25 07:29:11
问题 my first button creates a simple user like this: 'click .insertBtn': function() { var email = document.getElementById('email').value; var pass = document.getElementById('password').value; Accounts.createUser( { email: email, password: pass, profile: { name: 'test' } }); Roles.addUsersToRoles([this._id], ['admin']); } This user gets assigned a role of "admin". I then while I am logged in have a button to check if I am admin: 'click .checkRole': function() { console.log(Roles.userIsInRole

Push arbitrary data to a Meteor server

让人想犯罪 __ 提交于 2019-12-25 07:28:14
问题 I'm trying to make a dashboard that shows the time since our services were last deployed. This was the produce I was planning to use: The deploy script is invoked. At the end of the script my Meteor server is notified of the deploy by the script. The server inserts a documents containing information about the deploy. All clients receive the new document and re-renders. The only problem I'm having is with step #2. The nicest way to do this would be if the server could somehow subscribe and

meteor compilation - error output doesn't show where is the error?

╄→гoц情女王★ 提交于 2019-12-25 07:21:34
问题 I am trying to run my meteor app, and get the following runtime error : While processing files with ecmascript (for target os.osx.x86_64): native: Unexpected token } at Object.parse (native) at BabelCompiler.BCp._inferFromPackageJson (packages/babel-compiler/babel-compiler.js:165:1) at BabelCompiler.BCp.inferExtraBabelOptions (packages/babel-compiler/babel-compiler.js:139:1) at BabelCompiler.BCp.processOneFileForTarget (packages/babel-compiler/babel-compiler.js:81:1) at BabelCompiler.

Change button text in Meteor with JS

狂风中的少年 提交于 2019-12-25 07:15:04
问题 My button on click show and hide div that contains comment section. Now I want to make him to change text on click. So, you click once and you can see comments but instead of 'Show comments' hes text now needs to be 'Hide comments'. I tried several solutions that I found on internet and a couple of solutions that were logic to me but it's not working. I tried this too but it says that SetSession is not defined. Template: <template name="PrikažiMe"> <button class="PrikažiKomentar"> {{текст}} <

Meteor: Adding an associated record doesn't work

て烟熏妆下的殇ゞ 提交于 2019-12-25 07:14:40
问题 I have Posts and Comments and I'm trying to build the UI for adding a comment to a post using React and Meteor. When I submit a comment, the new comment appears and then immediately disappears. When I refresh the page, the new comment is there. Meteor.publish('post', function(postId) { return Posts.find(postId); }); Meteor.publish('comments.forPost', function(postId) { const post = Posts.findOne(postId); return Comments.find({_id: { $in : post.comments } } ); }); Meteor.methods({ 'comments

Linking local node.js module inside local Meteor Package

血红的双手。 提交于 2019-12-25 07:01:45
问题 I'm in the process of developing a Meteor package, that has a dependency on a node module. This module is also, under development, so right now it's just a local folder. Looking around, it seems that adding Npm.depends({ "npmmodulename": "x.x.x"}); on the package.js file, it should be enough, but how do I do this, when the npm module is local? I tried adding the path to the module, instead of the version, but I had no luck... Can this be actually done? 回答1: You don't need to specify an Npm