spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
  Home » METEOR » Page 1
what is this.data() in meteor or iron-router
Neither of the two are any better than the other -- each serves a different function, though seemingly similar. this.data() returns the data context of the route, which is essentially the stuff you're returning from the data function inside of your route. On the other hand, ready returns a boolean to signify that the subscriptions you are waiting on have returned (or otherwise called this.ready

Categories : Meteor

How do I handle disconnected user in meteor / iron:router
You can only track tab events because the window Javascript API makes this possible.. for tracking the whole browser's close method it would be very intrusive to do so and safe to say that you'll never track it effectively unless you resort to highly intrusive (mostly illegal) methods. One legal way is to convince the user to install a browser extension just for that..

Categories : Meteor

Publish all user profiles using Meteor and Iron Router
You're close - in the find options you need to specify that you are limiting the fields like this: Meteor.users.find({}, {fields: {profile: 1}}); See the field specifiers documentation for more details.

Categories : Meteor

Programmatically (not declaratively) render Meteor template
That function was not removed, it was renamed and quite a while ago it also changed behaviour (when spark was replaced by blaze). What you are looking for is Blaze.renderWithData. Note that it returns a Blaze.View and not a DOM object. To make it a dom object you could provide it as a parent: var renderedCalendarEvent = document.createElement("div"); Blaze.renderWithData(Template.calenderEven

Categories : Meteor

using contenteditable with wysiwyg in meteor
Could you wrap the state in a session variable? Of course, you'd need to set it back again once the redactor was finished (maybe try hooking into a blur event?) Template.home.events({ "click section.editable": function(event) { var isEditorActive = Session.get("editorActive", false); if (!isEditorActive) { Session.set("editorActive",true); $(event.targe

Categories : Meteor

Working with gmaps on meteor
I'm not a web whiz, but off the top of my head, you need to create a new template for the {{> map_template}}. Make sure to name the class inside map_template and then create a css template inside your style.css or wherever you are getting your CSS from. Your CSS should end up something like: .map-template{ //style stuff } Where {map-template} matches your class name. I used this questi

Categories : Meteor

Meteor get static data from a collection for search engine
waitOn: function() { return Meteor.subscribe("dbName"); } try this in router, to wait subscription complete before render or try fastRender package

Categories : Meteor

Exception in template helper: Cannot read property 'name' of undefined
First of all, there is better way to do what you want to achieve- wrap all your html with {{#with user}} tags like this: <template name="userProfile"> {{#with user}} <title>My Profile</title> <table> <tr> <td>User Name: </td> <td>{{userName}}</td> </tr> <tr>

Categories : Meteor

How to insert or render a template after another template is rendered in Meteor?
var head = document.getElementsByTagName('head')[0]; var script = document.createElement('script'); script.type = 'text/javascript'; script.onreadystatechange = function() { // if (this.readyState == 'complete') { callFunctionFromScript(); } } script.src = 'path/to/your-script.js'; head.appendChild(script); u can directly apped it into html head tag inside Template.layoutHeader.rendered = f

Categories : Meteor

Does Meteor and Iron Router's yield have an event hook? Template.yield.rendered?
If you really need to have the hook on 'any' template, you can define a nested yield template: <template name="layout"> {{> header }} {{> nested_yield }} {{> footer }} </template> <template name="nested_yield"> {{> yield }} </template> then Template.nested_yield.onRendered(function() { //your render code here }); However you might run into i

Categories : Meteor

Meteor.js - automatically updating one Mongo collection when another mongo collection changes?
You can use an observer: CollectionOne.find({createdAt: {$gte: new Date()}}).observe({ added: function (document) { // Do something to collection 2 }, changed: function (newDocument, oldDocument) { // ... }, removed: function (oldDocument) { // ... } }); So added, changed and removed are fired when the documents from CollectionOne are added, chang

Categories : Meteor

In my meteor app, how do I make authenticated google API calls on behalf of my user?
So I started trying to implement all of this myself on the server side, but was wary of a lot of the hard-coding I was doing and assumptions I was making to fill gaps. My security prof. used to say "never implement encryption yourself", so I decided to take another gander for a helpful package. Revising search criteria to "JWT", I found jagi's meteor-google-oauth-jwt on Atmosphere. The readme is c

Categories : Meteor

How to deploy meteor app in production server using Centos7
First of all, you don't need to install meteor on production server. Node.js is enough. On my Centos server, I use nginx + supervisord to run my meteor app. You should build your app with "meteor build --directory " command. With this command you will get a bundle directory. Compress that bundle folder and upload it to the server. Example meteor build --directory <some_path> Extract in on

Categories : Meteor

Meteor.setTimeout doesn't return handle server-side
I've tested in a regular node.js REPL, and that's what setTimeout returns. Passing it to Meteor.clearTimeout should work fine. The only problem is the documentation, which incorrectly states that the arguments to Meteor.clearTimeout and Meteor.clearInterval have type Number, whereas it only has that type on the client.

Categories : Meteor

Debug Meteor Velocity Mocha tests
Use meteor debug instead of meteor run to start your meteor application. It will add the node inspector package to your running Meteor app so that you can debug it. Node inspector works by hooking into your running Meteor server

Categories : Meteor

Where to put native code for push notifications with new Meteor Mobile platform
TL;DR : The cordova project is in the .meteor/local/cordova-build subfolder. The default AppDelegate.m gets created in the .meteor/local/cordova-build/platforms/ios/***YOUR_APP_NAME***/Classes subfolder. If you add a top-level folder called cordova-build-override to your meteor project, the directory tree that it contains will be added to the .meteor/local/cordova-build folder just before the b

Categories : Meteor

Meteor external API calls limit the calls or Sleep?
Good way to make pauses or intervals in Meteor is to use Timers, such as setTimeout() or setInterval()

Categories : Meteor

Collections not showing on page
You template is making the assumption that the cursor is being stored in coutries. It isn't. It would be if your data hook looked like: return {countries: Countries.find()}; As your code is written, the cursor is the context for your template so this should work: {{#each this}} <tr> <td>{{name}}</td> </tr> {{/each}}

Categories : Meteor

Meteor: subscribe to external datasource
Enclose call to meteor collection into new fiber as shown as follows- external_subscriber.on('message', function(data) { new Fiber(()-> meteor_collection.insert({newdata:data.toString()}); ).run() })); This should work

Categories : Meteor

Meteor publication with calculations
Yea, this is a known "problem". Publish functions aren't reactive, so Meteor.users.findOne(this.userId).projects will only be evaluated when the client subscribes. You'll find a lot of information about this if you search for "meteor reactive joins", for example https://www.discovermeteor.com/blog/reactive-joins-in-meteor/ In your case, the clients will always have access to their array of projec

Categories : Meteor

Printing HTML code inside Meteor Template
I don't know if it's possible to use variables inside an HTML tag, but if want to pass HTML code from your variable to the client, simply use {{{variable}}} instead of {{variable}}.

Categories : Meteor

How do I create a local Meteor package, with scaffolding? (Meteor 0.9.x+)
You can do the following straight from your project directory: meteor create --package username:my-package-name Source: http://docs.meteor.com/#/full/writingpackages

Categories : Meteor

Unable to run meteor from Webstorm
I'm not sure about my answer for your specific scenario: I had a similar problem and the cause was the npm permissions, I had to run meteor as root: sudo meteor I see in your paste: Error: EACCES, permission denied '/Users/jackal/rschtml5/ageroRSCHTML/.meteor/local/build' at Object.fs.renameSync Some permission is wrong. I usually use the terminal in WebStorm, not the built-in build and run. Pro

Categories : Meteor

OnscreenDiv error while using tinytest
I got the same problem. It is an old example. When I run Meteor 1.1.X, I change that block with: UI.insert(UI.render(Template.meteorErrors), document.body); and it work.

Categories : Meteor

Proper way to .findOne() in Iron:router
It's working properly in my application. I implemented it like this: Router.map(function() { this.route('training', { path: '/training/:id', data: function() { return Trainings.findOne({id: this.params.id}); }, notFoundTemplate: 'notFound', title: "Training" }); });

Categories : Meteor

Installing Meteor on an old 32-bit Mac
You'll have to rebuild Meteor from scratch: Git clone the meteor repository and run scripts/generate-dev-bundle.sh. You may also need Homebrew to install any dependencies it asks for. Looking at the source https://github.com/meteor/meteor/blob/devel/scripts/generate-dev-bundle.sh#L23, it may work if you're on an i386 and not the older powerpc units.

Categories : Meteor

Iron Router: Get the name of the current controller
Got it! After hours of searching, I found it defined at: Router.current().route.options.controller. Note that if the current controller is the default controller (RouteController) you will get undefined. @SG_ your comment helped me get there. thanks again.

Categories : Meteor

How to return 404 using Iron Router
this.route('template404', { path: '/*' } Use it at the end of your Router.map, cause this catches every value - if you use at the begining every path will be caught to this Of course you can make it more complex, for example: this.route('template404', { path: '/posts/*' }

Categories : Meteor


Recently Add
Meteor Iron-Router: why isn't this routing setup (with waitOn and data functions) working correctly?
what is this.data() in meteor or iron-router
How do I handle disconnected user in meteor / iron:router
Publish all user profiles using Meteor and Iron Router
Programmatically (not declaratively) render Meteor template
using contenteditable with wysiwyg in meteor
Working with gmaps on meteor
Meteor get static data from a collection for search engine
Exception in template helper: Cannot read property 'name' of undefined
How to insert or render a template after another template is rendered in Meteor?
Does Meteor and Iron Router's yield have an event hook? Template.yield.rendered?
Meteor.js - automatically updating one Mongo collection when another mongo collection changes?
In my meteor app, how do I make authenticated google API calls on behalf of my user?
How to deploy meteor app in production server using Centos7
Meteor.setTimeout doesn't return handle server-side
Debug Meteor Velocity Mocha tests
Where to put native code for push notifications with new Meteor Mobile platform
Meteor external API calls limit the calls or Sleep?
Collections not showing on page
Meteor: subscribe to external datasource
Meteor publication with calculations
Printing HTML code inside Meteor Template
How do I create a local Meteor package, with scaffolding? (Meteor 0.9.x+)
Unable to run meteor from Webstorm
OnscreenDiv error while using tinytest
Proper way to .findOne() in Iron:router
Installing Meteor on an old 32-bit Mac
Iron Router: Get the name of the current controller
How to return 404 using Iron Router
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.