meteor

Meteor / Blaze rendering : {{each}} in another {{each}} doesn't return the right data (data context)

◇◆丶佛笑我妖孽 提交于 2019-12-24 17:50:02
问题 I was wondering if you could give me some clue how to tackle this 'problem'. I'm a newbie in JS (+ Meteor), so it might be super simple for you. I'm working with helpers and blaze/spacebars for rendering. I have a simple helper: Template.monitoring.helpers({ 'realtime': function(){ return { house: house.find( {} ), neighbours: neighbours.find( {} ), } } // end of realtime }); // end of helpers At this point, everything is OK. I'm able to retrieve the data I want. The problem is that I'm not

Using Braintree on Meteor mobile (android - cordova)

旧街凉风 提交于 2019-12-24 17:43:24
问题 I am using Meteor 1.3 with android platform and patrickml:braintree@1.32.0 to be able to process in-app payments. I configured braintree and inserted a Drop-in UI, which is the simplest way to do it. While testing, if I run it on web (localhost) or with meteor run android-device with no mobile-server configuration, then the drop in UI is shown on the device. However, when I try to integrate everything on my hosted server in Digital Ocean and try to test it using: meteor run android-device -

how to see complete log on nitrous.Io console

落花浮王杯 提交于 2019-12-24 17:39:46
问题 i can't visualize the whole log in nitrous.io console , i'm using Meteor , and it's important to me to be able to see the complete log . any suggestions ? 回答1: Regardless of what type of stack your container is set up for, you should be able to use the Ctrl and +/- buttons to scroll through the console. Otherwise you can always use the less command by typing command | less (source) 来源: https://stackoverflow.com/questions/28770868/how-to-see-complete-log-on-nitrous-io-console

Meteor and CoffeeScript: Cannot call method 'helpers' of undefined

自闭症网瘾萝莉.ら 提交于 2019-12-24 17:37:08
问题 I just set up CoffeeScript (I'm also using Jade) for Meteor and it seems that my helpers (rendered and events functions too) do not work anymore. Template.signIn.helpers showForgotPassword: () -> return Session.get('showForgotPassword') The code seems to be properly generated but is embraced in an anonymous function. I'm getting the following error in the web console: Uncaught TypeError: Cannot call method 'helpers' of undefined (account.coffee:12) I'm wondering whether the code is run before

Minimongo errors when I try to update a document containing an array

混江龙づ霸主 提交于 2019-12-24 17:23:52
问题 I'm having trouble updating an array that is contained in a document using angular-meteor. Minimongo throws an error documentMatches needs a document . The document that throws this error on update is shown below. One thing it contains is an array of _id s. This array contains the display order of some certain documents. It looks like this: { _id:"...", profileQuestions:{ profileQuestionsOrder:["jqKMp7rzsZApauwYE","jakehILKehpkdhj"] } } I have attached this using $scope.meteorObject to a

Find & return first matching subdocument from array (Meteor / Mongo)

自古美人都是妖i 提交于 2019-12-24 17:15:54
问题 how do I find and return the first subdocument in the 'tasks' array that matches completed: true? using findOne returns the entire document.. is there another function for returning a subdocument? { title: 'awebsite.com' company: 'a company' companyID: Random.id() category: 'website' starred: false timeline: { tasks: [ { name: 'task1' completed: true todos: [ {todo: 'something', completed: false, todoID: Random.id()} {todo: 'something', completed: false, todoID: Random.id()} {todo: 'something

How to return subdocuments from an object in an array with Meteor and MongoDB

核能气质少年 提交于 2019-12-24 17:08:13
问题 This is a followup question from my previous question here on stackoverflow.com. Firstly, Thanks to @David Weldon: I was able to structure my update properly. However when I go to get the output from the database the object I added to score seams to be missing. Maybe this is the default behavior of db.ideas.find() . I expected to also get the subdocuments when I performed the db.ideas.find() . Code I ran: Ideas.update("bKXXrpYmppFBfq9Kx", { $addToSet: { score: { userId: "W9YEs84QFhZzJeB6j",

How to get this.userId in function inside Meteor method

巧了我就是萌 提交于 2019-12-24 16:57:09
问题 I need to call a few times a function for every user who is logged in, but when the function is placed inside meteor method, this.userId becomes undefined inside function scope, here's the example: myMethod: function(){ console.log(this.userId); // this returns proper userId function innerFunction(){ console.log(this.userId); // this returns undefined }; innerFunction(); } How can I pass this.userId inside a function? Does a function has to be binded with Meteor.bindEnvironment? 回答1: You have

Template.subscriptionsReady disables onRendered functionality

牧云@^-^@ 提交于 2019-12-24 16:26:10
问题 I am initializing datepickers and form validation in Template.templatename.OnRendered. $('#dateAccepted').datepicker({ endDate: new Date(), todayBtn: true, todayHighlight: true, autoclose: true }); I am doing subscriptions, collection queries etc in Template.templatename.onCreated. Template.insertContract.onCreated(function () { var self = this; self.autorun(function() { self.subscribe('getContracts'); self.subscribe('getSuppliers' ,function(){ var suppliers = Supplier.find({}).fetch(); var

Secure meteor admin functionality

梦想的初衷 提交于 2019-12-24 16:03:20
问题 I have a couple of admin functions I want to add to a meteor site and was wandering what is the best way to create, hide and protect them ? Thanks 回答1: You can use Meteor.methods. Just be sure to only include them on the server, by placing the code in a folder called server/ E.g. server/admin.js Meteor.methods({ foo: function (arg1, arg2) { // confirm that the user is an admin if ( ! this.user.isAdmin ) throw new Meteor.Error(401, "You are not authorized to perform this action"); // perform