meteor

Confusion about Meteor _uihooks and what triggers them

我与影子孤独终老i 提交于 2019-12-30 07:13:16
问题 I'm confused about how _uihooks works. Check out the below code: home.html <template name="homePage"> <section id="home-page"> <div class="container"> <h1>Thought of the day:</h1> <div id="totd"> <span>{{thought}}</span> </div> </div> </section> </template> home.coffee timer = 0 Template.homePage.rendered = -> this.find('#totd')._uihooks = insertElement: (node, next) -> console.log 'Inserted' removeElement: (node) -> console.log 'Removed' Session.set 'randThought', Random.choice thoughts

Meteor : how to publish custom JSON data?

时光总嘲笑我的痴心妄想 提交于 2019-12-30 07:11:30
问题 Edit: The solution I used is @Kyll's one. Suppose the server side objects I'd like to return are "complicated" to build and need different attributes from different collections. I first tried: /server/publications.js Meteor.publish('myCustomDocument', function(){ // suppose here that I need to X.find() different collections // and create a complex Array of JSON data (which contains different // attributes from different Collections return [ {appName: 'aName', category: 'catName', anotherField

Serving an “index.html” file in public/ when using MeteorJS and Iron Router?

≯℡__Kan透↙ 提交于 2019-12-30 06:41:26
问题 I want to serve a static HTML file from MeteorJS's public folder (as is possible with Rails and Express). The reason I'm doing this is because I have one template for the dynamic "admin" part of my webapp and another for the sales-y "frontend" part of the app. I don't want this file to be wrapped in a Meteor template as suggested in this answer as it will automatically bring in the minified CSS, etc... that the dynamic pages use. Is there a way I can setup the public folder (and all its

Accessing to DB at client side as in server side with meteor

回眸只為那壹抹淺笑 提交于 2019-12-30 06:26:08
问题 I read this at the docs: Database Everywhere. Use the same transparent API to access your database from the client or the server. This is great, but I think there are some security issues. Providing full and transparent access to the database at client side you are exposed to bad users, which modify you JS code (it's really at his browser and he can do it) and add any database action that could retrieve/remove/update data that perhaps could be sensible. Please, correct me if I'm wrong. Thanks

cursor.observe({added}) behavior in Meteor

泪湿孤枕 提交于 2019-12-30 06:11:10
问题 I'm trying to display an alert to the user when data is added to the database. So I wrote (on the client side) : Meteor.autosubscribe(function() { ItemCollection.find().observe({ added: function(item) { // Alert code } }); }); And I found that not only alerts are displayed when a new item is added to the database on the server side ( which I suppose is normal :) ) but alerts are also displayed for each previously added item when I refresh the page. I suppose Meteor fetch all the data from the

cursor.observe({added}) behavior in Meteor

孤者浪人 提交于 2019-12-30 06:10:42
问题 I'm trying to display an alert to the user when data is added to the database. So I wrote (on the client side) : Meteor.autosubscribe(function() { ItemCollection.find().observe({ added: function(item) { // Alert code } }); }); And I found that not only alerts are displayed when a new item is added to the database on the server side ( which I suppose is normal :) ) but alerts are also displayed for each previously added item when I refresh the page. I suppose Meteor fetch all the data from the

Operational Transformation in Meteor.js?

眉间皱痕 提交于 2019-12-30 06:08:35
问题 Does Meteor.js support Operational Transformation yet? I'm working on a project which is some what related to Etherpad for which I thought of using Meteor.js(which I think is very much suited for this kind of project). Operational transformation is very important for my project if I think of making it scalable. My current knowledge suggest that meteor does't support operational transformation out of box (correct me if I am wrong here). So basically my question is how to implement operational

Operational Transformation in Meteor.js?

最后都变了- 提交于 2019-12-30 06:07:16
问题 Does Meteor.js support Operational Transformation yet? I'm working on a project which is some what related to Etherpad for which I thought of using Meteor.js(which I think is very much suited for this kind of project). Operational transformation is very important for my project if I think of making it scalable. My current knowledge suggest that meteor does't support operational transformation out of box (correct me if I am wrong here). So basically my question is how to implement operational

How to use jQuery in Meteor 1.0

a 夏天 提交于 2019-12-30 04:42:05
问题 I am trying to use jquery like this in meteor.js app. JS: if (Meteor.isClient) { Meteor.startup(function() { $( "button" ).click(function() { $( "p" ).toggle(); }); }); ... Or without meteor.startup function. Neither works. HTML: <button>Click</button> <p>Can you see me?</p> I get no errors and nothing happens when I click the button. 回答1: You shouldn't use jQuery for simple event handling like this, use Meteor templates event maps instead : HTML : <template name="myTemplate"> <button type=

Correct way to setup Virtualbox 4.3 to use symlinks on guest (for meteor)

人盡茶涼 提交于 2019-12-30 00:56:27
问题 I use Windows 8 and installed Virtualbox so i can access to a Linux (Ubuntu) System. The most i still did to do this - so at this moment i have a working Virtualbox with Ubuntu 14.04 LTS. In my case i need this Virtualbox with Linux for meteor. The problem: meteor uses nodejs and so i need to have symlinks access (i think its symlinks - i read a few about it) Reference: How to run meteor app inside an Ubuntu VrtualBox and edit using an editor on a Windows host? He describes the same problem i