meteor

Passing array via ReactiveVar in Meteor

僤鯓⒐⒋嵵緔 提交于 2020-01-05 05:01:21
问题 I have a Meteor method that returns all user accounts on my application returnUsers: function(){ return Meteor.users.find().fetch(); } I'm using new ReactiveVar to pass the return value of the Meteor method into my template helper: Template.listViewTemplate.created = function (){ var self = this; self.myAsyncValue = new ReactiveVar("Waiting for response from serv er..."); Meteor.call('returnUsers', function (err, users) { if (err) console.log(err); else self.myAsyncValue.set(users); }); }

Installing bootstrap 3 with meteor

佐手、 提交于 2020-01-05 04:43:19
问题 I've read a lot of posts about how bootstrap can be included in your meteor project and more recently, I've seen people using meteor add mizzao:bootstrap-3 like in this anwser. The thing is when I try to do it I get the following error : mizzao:bootstrap-3: no such package Is there another version I need to use or is there another way to add bootstrap 3 to a meteor project. 回答1: For meteor 0.9 or above meteor add mizzao:bootstrap-3 For meteor < 0.9 use meteorite to add packages. npm install

Can't get Chartist legend plugin to work

房东的猫 提交于 2020-01-05 04:33:11
问题 I've got the mfpierre:chartist meteor package installed and the mspi:chartistlegend plugin for it installed (both atmosphere packages). I've got the plugin like so: new Chartist.Bar('.ct-chart', { labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], series: [ [1,2,3,4], [1,2,3,4], [1,2,3,4] ] }, { plugins: [ Chartist.plugins.legend() ] }); The chart won't render with the "plugins" key/value pair in place. If I remove the "plugins" key/value, the chart

Meteor Subscribe & Publish with external api

老子叫甜甜 提交于 2020-01-05 04:32:04
问题 I'm trying to connect my Meteor Subscribe and Publish to my api, the Publish is calling the API and returning the data no problem but I cant seem to load my data on the template. Below is my code. boards.js import './boards.html'; Tracker.autorun(function() { Meteor.subscribe('getUserBoards'); }); boards.html <template name="userBoards"> {{#each boards}} {{this.id}} {{/each}} </template> index.js if (Meteor.isServer) { Meteor.publish('getUserBoards', function getBoards() { var self = this;

Uploading Meteor up to AWS E.Beanstalk Error

爱⌒轻易说出口 提交于 2020-01-05 04:25:07
问题 A Meteor project being uploaded to AWS Elastic Beanstalks using the AWS console. The content of the root folder including the hidden files and folders without .git and .idea are being zipped and that zipped.zip file was uploaded. The content of the package.json is: { "name": "Appname2", "version": "0.0.1" } The beanStalk console is reporting Error: No start scripts located in package.json. Node.js may have issues starting. Add start scripts or place code in a file named server.js or app.js.

How do I access a collection from more than one file in Meteorjs?

故事扮演 提交于 2020-01-05 04:14:13
问题 In my main js file I have defined a "new Meteor.Collection("Decks")" and I populate some data if there is no data. Now I have a views folder in the client folder that has the javascript for events of the templates. Each template has it's own js file. Those events need to query and update the Decks collection, but I have no idea how I would do that. I tried writing a "new Meteor.Collection("Decks")" in the event code, but I got an error that the collection already exists. I could imagine using

How to make injected service reactive in Angular2-Meteor

大憨熊 提交于 2020-01-05 03:59:14
问题 I am new to Angular2 and am trying to get a custom Component to use a Service which manages a registry of Mongo.Collection objects. My problem is that I cannot seem to get Angular to refresh the UI when the Collection has loaded. If you take a look at the code below you will see that there is a Component which has a DatasetService injected. This service manages a registry of Collections. I am guessing that the problem is related to the fact that the Meteor.autorun() method takes the

Update Node version for Meteor app deployed to Heroku

与世无争的帅哥 提交于 2020-01-05 03:58:26
问题 I have a Meteor application deployed to Heroku. To prevent the Denial of Service (DoS) vulnerability, Heroku suggested updating the Node.js version for my application. I want to update the meteor version to 1.2.1 and node version to 4.8.4 on Heroku. I have set the node version in packages.json as well but it was not updated after deployment. How can I update meteor and node on Heroku? I tried the following command: heroku run meteor update --release 1.2.1 -a myappname but it throws the

Meteor collection2 array with Strings and Object

余生颓废 提交于 2020-01-05 03:49:07
问题 i'm using Meteor with collection2 and I have an array that looks like this: productTypes = ["string1", "string2", "string3", {Other: "test"}] Essentially there will be anywhere from 0 to 7 strings in the array, and Other: 'Test' may or may not be present So i'm trying to make a schema that handles that case. Is there a way to tell it that there will be strings and an object within an array? I've tried const residentSchema = new SimpleSchema({ productTypes: {type: [String, Object], optional:

Meteor js custom pagination

喜你入骨 提交于 2020-01-04 18:57:09
问题 I kindly need a support. I have written a pagination following a YouTube tutorial, which works fine with the exception of when going backwards again. It has only 2 buttons, previous and next , when the next button is clicked it works fine but the previous button only go backwards once. Let's say I have 20 records in the collections paginated to display 5 at a time, the next button could go to the end to the fourth page but the previous button would not go pass one step backwards. Please what