meteor-blaze

Making bootstrap calendar render when data change in meteor

别说谁变了你拦得住时间么 提交于 2020-01-16 19:17:12
问题 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 () {

How to access FlowRouter subscriptions in Meteor template helpers?

耗尽温柔 提交于 2020-01-16 03:08:08
问题 it seems like I can't access a FlowRouter template subscription in my helper. How can you do this? In my server code: Meteor.publish('AllUsers', function() { return Meteor.users.find({}, {fields: {profile: 1}}); }) In my router code: var userRoutes = FlowRouter.group({ subscriptions: function(params, queryParams) { this.register('AllUsers', Meteor.subscribe('AllUsers')); }, }); In my template code: {{#if checkFlowRouterSubs}} {{#each getTheUsers}} {{>userPartial}} {{/each}} {{/if}} In my

How do you get all instances of a Template?

牧云@^-^@ 提交于 2020-01-14 13:57:11
问题 I know I can get a single template instance by doing Blaze.getView(node) . But how can I find all instances of Template.foo ? 回答1: If we borrow walkTheDOM from Crockford, we can drop this into the browser console and find all template instances on any page function findAllTemplateInstances(templateName){ function walkTheDOM(node, func) { func(node); node = node.firstChild; while (node) { walkTheDOM(node, func); node = node.nextSibling; } } var instances = []; walkTheDOM(document.body,

How do you get all instances of a Template?

爱⌒轻易说出口 提交于 2020-01-14 13:54:52
问题 I know I can get a single template instance by doing Blaze.getView(node) . But how can I find all instances of Template.foo ? 回答1: If we borrow walkTheDOM from Crockford, we can drop this into the browser console and find all template instances on any page function findAllTemplateInstances(templateName){ function walkTheDOM(node, func) { func(node); node = node.firstChild; while (node) { walkTheDOM(node, func); node = node.nextSibling; } } var instances = []; walkTheDOM(document.body,

Remove inserted template in meteor 0.8.0

非 Y 不嫁゛ 提交于 2020-01-12 07:42:08
问题 I am inserting templates using UI.render() and UI.insert(). When I tried to remove the template I inserted, it seems to stay in memory and the destroyed method is not called. According to the documentation, it should clean up property if I use jquery to remove the element. I'm testing it using the following code: test.html: <head> <title>removeTest</title> <style> #content { height: 500px; width: 500px; background-color: gray; } </style> </head> <body><div id="content"></div></body> <template

Meteor WebSocket is already in CLOSING or CLOSED state error

不打扰是莪最后的温柔 提交于 2020-01-07 05:32:09
问题 After implementing Detecting idle time in JavaScript elegantly I get "WebSocket is already in CLOSING or CLOSED state" error in the browser console. How to fix this issue? Here is my code: var inactivityTime = function () { var t; window.onload = resetTimer; document.onmousemove = resetTimer; document.onkeypress = resetTimer; function detector() { alert("You are idle!"); } function resetTimer() { console.log("RESET!"); clearTimeout(t); t = setTimeout(detector, 10000) // 1000 milisec = 1 sec }

Meteor passing an id into a link

£可爱£侵袭症+ 提交于 2020-01-06 19:53:21
问题 now my database is working i want the user to click on one of the things in the database to get a more detailed view but the id of the data is not inserted in the link <template name="meineEvents"> <ul> {{#each event}} <li>{{name}}</li> {{/each}} <a href="/eventDetails/{{_id}}">mehr Details</a> </ul> </template> but when i click on the link i only see the http://localhost:3000/eventDetails/ without the id behind the eventDetails/ im running Meteor 1.4 with Blaze Thank you for your help ;) 回答1

Using Meteor Cluster for microservice

非 Y 不嫁゛ 提交于 2020-01-06 11:45:40
问题 Based on the simple implementation of Meteor Cluster MicroServices the doc I have this implementation for 2 services to communicate. AppUI export default CLUSTER_DISCOVERY_URL="mongodb://localhost:3000/meteor"; Cluster.connect(CLUSTER_DISCOVERY_URL); Cluster.register('appui_service'); loggerService = Cluster.discoverConnection('logger_service'); LoggerService export default CLUSTER_DISCOVERY_URL="mongodb://localhost:3300/meteor"; Cluster.connect(CLUSTER_DISCOVERY_URL); Cluster.register(

after upgrading to meteor 0.9.1 i keep getting “Warning: Blaze.insert has been deprecated.”

孤街醉人 提交于 2020-01-05 17:37:29
问题 Hi I just upgraded my meteor app to 0.9.1.1 and I keep getting these 2 warnings in my console W20140910-18:37:07.781(3) (blaze.js:67) Warning: Blaze.render without a parent element is deprecated. You must specify where to insert the rendered content. logging.js:65 W20140910-18:37:07.787(3) (blaze.js:67) Warning: Blaze.insert has been deprecated. Specify where to insert the rendered content in the call to Blaze.render. logging.js:65 I have no idea from where the error occurs, or why it happens

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;