iron-router

struggling to wait on subscriptions and multiple subscriptions

吃可爱长大的小学妹 提交于 2019-12-09 23:26:08
问题 i am really struggling with the iron-router waitOn. I have a number of subscriptions that i would like to waitOn, it doenst seem to me that iron router is waiting on anything. I have setup a number of subscriptions (main.js), which i would like to load before the application starts: Meteor.subscribe("appointments"); Meteor.subscribe("business"); Meteor.subscribe("clients"); Meteor.subscribe("staff"); I have tried almost every configuration i possibly can but i cannot seem to get the "loader"

How do I activate an Iron Router route without changing the path?

旧巷老猫 提交于 2019-12-08 21:00:30
In my Meteor app, I'm trying to pass data from my Iron Router controller to a template that's a partial in my app. How do I activate a route without changing the path? I don't want to switch pages, only render the partial with my data (if that makes sense). Here's how the app works: Right now, the route is activated when I click a dropdown link in my navbar Template.navbar.events 'click #threads-link': (event)-> Router.go 'allThreads' This renders the template with my data as long as I have a path in my route. But since I don't want the path to change, I tried leaving the path--and then the

Meteor load scripts, CSS specific to pages

对着背影说爱祢 提交于 2019-12-08 18:20:47
问题 The problem I'm currently experiencing is, that I want to be able to execute only specific scripts and CSS files, because if executed on a wrong page, it produces errors in the browser console. I'm using "Iron router" for Meteor with only the basic code to make it work. Now, is there a way for me to send scripts as parameters, so it only loads the ones I want the page to load? 回答1: In short, there isn't. (Yet.) You probably have a wrong code structure if you've got errors. There are ways to

Trouble publishing/subscribing to a Mongo aggregate query

£可爱£侵袭症+ 提交于 2019-12-08 13:23:08
问题 Using Meteor and Iron-Router, I'm trying to publish the following mongo query (in the server folder): Meteor.publish("getTestList", function() { return Tests.aggregate( [{ $project : { "name" : 1, "description" : 1, "testNumber" : 1 } }, { $sort : { "testNumber" : 1 } } ]) }); Note that I have tested this query in the meteor mongo console tool and it works fine there. Also Tests is Tests = new Mongo.Collection("tests") and I am subscribing in the router like this: Router.route('/user', {

Useraccounts updated to Useraccounts:iron-routing

守給你的承諾、 提交于 2019-12-08 10:21:51
问题 updated my meteor app and had useraccounts on it and it suddenly told me to install the useraccounts:iron-routing to use it with Iron Router... Installed the package and now its telling me W20150818-19:23:20.744(-6)? (STDERR) Error: changePwd route configured but enablePasswordChange set to false! and won't start my app, but my AccountsTemplates.configure({ has all seted to true... here is the code: //Routes AccountsTemplates.configureRoute('changePwd'); AccountsTemplates.configureRoute(

Meteor: Render template inside a template

て烟熏妆下的殇ゞ 提交于 2019-12-08 10:19:34
问题 I have a list of names on 'postlist' template. These are 'usernames' of the person who created the post. I have created a href link so that when a user clicks on the name, they are routed/directed to a new template 'viewpost' and able to view the full post document. But, I would like the 'viewpost' template to get rendered where I have put {{> yield}} inside the 'postlist' template instead. How do I configure the layourTemplate because I already have one working for another part of the app.

jQuery plug-in not working with Iron Router

别等时光非礼了梦想. 提交于 2019-12-08 09:31:48
问题 I'm new to Meteor so I'm trying some code. I'm testing a jQuery plug-in to bring stylish image hover effects and it works when I'm not using Iron router but simple templates - {{> home}} not {{> yield}} - instead. So, I have a simple masterLayout template: <template name="masterLayout"> <p> Base Layout!</p> <img id="chard" src="chard.png"/> {{> yield}} </template> and a test home page: <template name="home"> <p> HOME page! </p> <img id="home" src="image.png"/> </template> I call the jQuery

No 404 not found template rendered for slugs Meteor

大憨熊 提交于 2019-12-08 06:11:13
问题 I setup a not found template and it only works for routes which don't have slugs in the URL. Furthermore, the iron-router-progress bar hangs at approx. 95% (same as for the forbidden template). I think it's because the client is waiting for subscription, but there is no returning data. Here is my code: var admin = function(pause) { if (Meteor.user()) { var member = Member.findOne({slug: this.params.slug}); if (member) { if (!Roles.userIsInRole(Meteor.userId(), [member.slug], ['admin'])) {

How do I use meteor subscriptionsReady() to ensure data is ready before rendering template?

雨燕双飞 提交于 2019-12-08 06:01:22
问题 One of the challenges of using a framework that is newish and under development is that the advice you find on the web is often outdated. This applies doubly to Meteor where the SO answers and web articles are often for a pre 1.0.x or an early 1.0.x version, or for the previous version of iron-router, or before they introduced a feature last week, and so on. Still puzzling over how to use the subscriptionsReady() function in the context of having a template wait until subscriptions are ready

Iron Router Route Allow/Deny

霸气de小男生 提交于 2019-12-08 05:23:27
I'm writing a a meteor application right now, and am getting used to the new Iron Router package (as opposed to the router package that I used before). I have a collection of routes that should only be accessible by users with specific properties. To be specific, I'm using the Roles package. My way of achieving this at the moment is to define a before function that runs a conditional, and redirects to a login or error page if the user doesn't have the proper role. Here's just a quick (coffeescript) example: this.route 'home', path: '/' template: 'dashboard' before: -> unless Meteor.userId()