meteor

Throwing Meteor.Error does not reach the client

馋奶兔 提交于 2020-01-17 06:02:30
问题 So basically, the client calls the server using a Meteor.call . The server method then does some validations and calls a web service using a meteor package. If validation fails and a meteor error is thrown, it reaches the server. If the package response has an error, it only logs on the server. I need the error to reach the client. Here's how the code looks like. Client Meteor.call('callService', (err, result) => { if(err) { console.log(err.reason); } }); Server Meteor.methods({ 'callService'

Add elements to collection based on a dynamic template

北慕城南 提交于 2020-01-17 05:07:27
问题 So I have a poll template that can have as many questions as the user wants. How do I insert all the questions into an element of a collection? Since I only had three before, I inserted them manually like this: var newPoll = { question: event.target.question.value, choices: [ { text: event.target.choice1.value, votes: 0 }, { text: event.target.choice2.value, votes: 0 }, { text: event.target.choice3.value, votes: 0 } ], usersWhoVoted: [], poll_is_open: true, time_poll_closed: null, }; If I can

How can i create multiple markers on a google map?

自闭症网瘾萝莉.ら 提交于 2020-01-17 04:11:27
问题 I need to show multiple pointers based on the given latitude and longitude values.I did one sample but it comes only one pointers.As shown code below. Meteor Js Code : this are my objects var latlong1 = { lat: 17.385044, long: 78.486671 } console.log("* 2 *"); var latlong2 = { lat: 16.306652, long: 80.436540 } var latlong3 = { lat:15.505723, long: 80.049922 } var latlong4 = { lat: 15.317277, long: 75.713888 } i know i can create it like this. var marker = new google.maps.Marker({ position:

How to use webshot with meteor

自古美人都是妖i 提交于 2020-01-17 03:06:08
问题 I've installed webshot package and meteor webshot smart package from: https://github.com/TimHeckel/meteor-webshot In the directory pacages/webshot/lib/webshot.js there is definition of WEBSHOT object. In the default meteor application I want to use this object to get the snapshot as show in the second step from the link above: Template.hello.events({ 'click input' : function () { var _image = "myscreenshot.png"; var _res = WEBSHOT.snap("http://google.com", "public/exports~/" + _image, {

Iron Router with multiple parts

自闭症网瘾萝莉.ら 提交于 2020-01-17 01:45:13
问题 I am using Meteor iron:router. I have a template called by the name 'multi'. So whenever I have paths like '/multi' or '/multi/BSC123' , I want 'multi' to be rendered. So far I have used an array approach like this Router.route('multi',{ path:['/multi','/multi/:_id'] }); This works fine. But when I use this approach, my left nav bar which has a href link to 'multi' template is not shown. So apart from the above approach, can anyone suggest me other solution where I can have two paths and same

Iron Router / Meteor - Post details with username in URL

社会主义新天地 提交于 2020-01-17 01:21:13
问题 I'm relatively new to Meteor (especially Iron Router), and have been stuck on the following issue... I have a route which displays details about a single post: this.route('singlePost',{ path:'/posts/:_id', data:function(){ return Posts.findOne(this.params._id); } }); This works fine, but I'd like to be able to show the post owner's username in the URL, rather than the static "/posts/" path, ex: this.route('singlePost',{ path:'/:username/:_id', data:function(){ return Posts.findOne(this.params

How do I get the built in formatting for UserAccounts Meteor to work?

十年热恋 提交于 2020-01-16 19:53:23
问题 I have included the UserAccounts (Semantic UI) package with the meteor app. On inserting the routes and the {{> atForm}}, this is how my front page looks. Which is very different from the examples shown here: UserAccount Page Steps taken: Deleted the entire Css Deleted and reinstalled other packages like Unstyled or boostrap But nothing works. Formatting is still the one in the picture. Can someone please help or provide advice? Let me know which codes you need to review, I'll post them on

using mongodump to extract meteor data

半腔热情 提交于 2020-01-16 19:33:04
问题 I'll preface this by saying I have very little coding knowledge other than a few mongo tutorials so this may be a very simple answer, I'm trying to extract the data from my meteor project into a text file that can be edited. Previously I've just had meteor (and Node.js) installed but I've installed MongoDB because without it my cmd window would tell me "'mongodump' is not recognized as an internal or external command, operable program or batch file" I then followed the instructions here and

Making bootstrap calendar render when data change in meteor

你说的曾经没有我的故事 提交于 2020-01-16 19:18:06
问题 I'm still struggling to get a calendar to re-render when data changes using meteor blaze. I have put in place an observerChanges function that is firing happily when added, removed or changed are triggered, but I have NO idea how to actually make the calendar update its state. The handler code is Meteor.subscribe("reqEvents"); allReqsCursor = Requests.find(); var handle = allReqsCursor.observeChanges({ added: function (id, user) { console.log("Request added"); }, removed: function () {

Making bootstrap calendar render when data change in meteor

让人想犯罪 __ 提交于 2020-01-16 19:18:02
问题 I'm still struggling to get a calendar to re-render when data changes using meteor blaze. I have put in place an observerChanges function that is firing happily when added, removed or changed are triggered, but I have NO idea how to actually make the calendar update its state. The handler code is Meteor.subscribe("reqEvents"); allReqsCursor = Requests.find(); var handle = allReqsCursor.observeChanges({ added: function (id, user) { console.log("Request added"); }, removed: function () {