iron-router

Meteor - iron-router not waiting on subscription data in onBeforeAction hook

笑着哭i 提交于 2019-12-08 04:11:17
问题 I want to set a Session variable ( artistNotAvailable ) when the requested artist is not available. Unfortunately, the route does not work, because it is not waiting on subscription data in my onBeforeAction hook. artistAvail and artist is undefined, but not because there is no artist in the DB, I think it is a subscription problem. I debugged it and calling Artists.find().fetch(); in the browsers console returned undefined . Here is my route: this.route('eventPage', { path: '/event/:slug/

Meteor's iron:router isn't doing {{renderRouter}} as expected or documented

笑着哭i 提交于 2019-12-08 04:00:24
问题 I've got a very simple template problem going on that appears to be similar to this guy's problem, though I've tried to build a simple example to demonstrate the problem and hopefully have someone explain to me how to fix or work around it. Although as I'm doing some online research, it may be that the official documentation is out of date with the code. The reason I haven't bought into accepting that just yet is that the problem seems to have existed for a while, the dates on such articles

How to hook before iron-router changes the current route?

倾然丶 夕夏残阳落幕 提交于 2019-12-08 03:39:49
问题 I work on a form where my user upload files to S3. If the user leave the form without validating it, even if files are uploaded, the files upload should be canceled and the files deleted from S3. I have no trouble deleting the files from my S3 bucket. However, I need to be able to delete them before the user leaves the current route (i.e. page) and skip it if the next route is the same page (i.e. a page refresh). This is an issue very similar to this one on Github where they say that,

Error when using iron:router with Meteor 0.9.3.1

家住魔仙堡 提交于 2019-12-07 21:21:58
问题 I am experimenting with Meteor and iron:router. I git cloned the examples from https://github.com/EventedMind/iron-router.git. I then cd-ed into samples/basic, and ran meteor update and meteor. My meteor version is 0.9.3.1 When I navigated to the website an error is displayed in console and the page is empty. The error is as below: Exception from Tracker recompute function: Error: Couldn't find a template named "/" or "". Are you sure you defined it? at null._render (http://localhost:3000

Meteor's Iron Router - Route multiple paths to one template but still DRY

本秂侑毒 提交于 2019-12-07 18:41:25
问题 I want to route multiple paths to the same template. For example, /abc/home and /home will both show the home template. The paths can also have subpaths, so abc/parent/child and /parent/child should route to same path also. I can simply repeat : Router.route('/home', function () { this.render('home'); Session.set('menu', 'home'); }); Router.route('/abc/home', function () { this.render('home'); Session.set('menu', 'home'); }); But I don't want to repeat it. If I want to change the template to

Iron router: Error: Couldn't find a template named “/” or “”. Are you sure you defined it?

断了今生、忘了曾经 提交于 2019-12-07 16:23:21
问题 I have trouble setting up a simple iron:router example: (docs, sample app) meteor create testapp cd testapp home.html : <template name="Home"> <h1>Welcome</h1> home </template> router.js : Router.route('/', function () { this.render('Home'); // Also tried 'home' }); Starting the server: meteor Then I get (client side): Exception from Tracker recompute function: Error: Couldn't find a template named "/" or "". Are you sure you defined it? at null._render (http://localhost:3000/packages/iron

How do I serve a file from S3 through Meteor Iron Router

孤街浪徒 提交于 2019-12-07 12:10:25
问题 My question is very similar to this one which describes how to serve a local file using Iron Router. I need to do the same, but instead of reading the file synchronously from disk, I need to get the file from S3 which is an asynchronous call. The problem appears to be the fact that the action method has returned before the asynchronous s3.getObject completes giving me the following error. Error: Can't render headers after they are sent to the client. I'm assuming that Iron Router is

Creating active navigation state with Meteor and Iron Router

别来无恙 提交于 2019-12-07 07:41:26
问题 I want to add a class of 'active' to the nav list item that is currently being rendered by Iron Router. Here's my markup: <ul> <li> {{#linkTo route="option1"}} <span class="fa fa-fw fa-option"></span> Option 1 {{/linkTo}} </li><li> {{#linkTo route="option2"}} <span class="fa fa-fw fa-option"></span> Option 2 {{/linkTo}} </li> </ul> I've read through the guide and various articles but can't find this covered anywhere. Assuming I'll need some sort of helper? 回答1: I think you might find meteor

Meteor account email verify fails two ways

纵饮孤独 提交于 2019-12-07 04:03:11
问题 I have email hooked up on my dev box, and get a verification email after creating a user. I can click on the included link, and it will bring me to my main page. 1) Clicking on the link seems to do some processing, because it redirects to /, but it does not change the verified flag on the user account. 2) It seems to ignore my Accounts.config setting, and only works when I explicitly call token = Accounts.sendVerificationEmail(userId) Details: mrt --version Meteorite version 0.6.11 Release 0

Meteor - iron-router not waiting on subscription data in onBeforeAction hook

别说谁变了你拦得住时间么 提交于 2019-12-06 21:47:27
I want to set a Session variable ( artistNotAvailable ) when the requested artist is not available. Unfortunately, the route does not work, because it is not waiting on subscription data in my onBeforeAction hook. artistAvail and artist is undefined, but not because there is no artist in the DB, I think it is a subscription problem. I debugged it and calling Artists.find().fetch(); in the browsers console returned undefined . Here is my route: this.route('eventPage', { path: '/event/:slug/:openDate?/:closeDate?', onBeforeAction: [teamFilter, function() { var event = this.data(); if (event