iron-router

subdomain support in meteor (like with slack - http://team.slack.com)

徘徊边缘 提交于 2019-12-20 10:20:52
问题 subdomain support in meteor (like with slack - http://team.slack.com) As in slack my app users can create their own subdomains (unique) and depending on the subdomain the data should be loaded, and around this the application would be proceeded. I can use something like http://slack.com?team=TeamName, but i think the subdomain would be much clean and better. Any suggestions/pointers. Thanks. 回答1: Taken from the Meteor forums. Using a DNS wildcard to point *.example.com to my app server, I

Multiple subscriptions in iron router

心已入冬 提交于 2019-12-20 09:42:37
问题 I have been working on an application using a comment function. That results in having to subscribe to both a collection which the comments are made on and the comments collection itself. Now it looks like this: <template name="bookView"> {{> book}} {{> comments}} </template> this.route('book', { path: '/book/:_id', template: 'bookView', waitOn: function() { return Meteor.subscribe('book');}, action: function () { if (this.ready()){ this.render(); } else this.render('loadingTemplate'); },

Cannot add package iron router for meteor on windows 8.1 pro

南楼画角 提交于 2019-12-20 06:45:01
问题 I installed meteor on windows from http://win.meteor.com/. I was trying to install iron router package for meteor on windows 8.1 by downloading following repositories git clone https://github.com/tmeasday/meteor-router.git After downloading i renamed the folder to iron-router. Then i downloaded other repositories git clone https://github.com/tmeasday/meteor-page-js-ie-support.git git clone https://github.com/tmeasday/meteor-HTML5-History-API.git git clone https://github.com/EventedMind/blaze

How do I reload the current iron:router route?

淺唱寂寞╮ 提交于 2019-12-19 17:31:40
问题 If I'm currently at /foo , Router.go '/foo' does nothing. I would like /foo 's action hooks and rendering to be redone. I know I could make a dependency, mention it in an action hook, and invalidate it when I need to reload, I'm just hoping there's a Router.* api I can use, because that would be cleaner. 回答1: This adds a function Router.rerun() that works: login_dep = new Tracker.Dependency Router.rerun = -> login_dep.changed() Router.configure onBeforeAction: -> login_dep.depend() ... 回答2:

Multiple yield in Meteor.js application template

戏子无情 提交于 2019-12-18 16:58:29
问题 I have one general {{>yield}} for iron-router in a layout file which renders my pages, which are templates. In one of my pages, I have a side menu and according to the selection in this menu, I want to load different templates related to this page in this page. How can I achieve this? 回答1: I have done a similar thing using iron-router's layout template option. Say I want to create a home view with multiple views/templates inside of this home view that will change. First I would declare my

Multiple yield in Meteor.js application template

梦想与她 提交于 2019-12-18 16:58:19
问题 I have one general {{>yield}} for iron-router in a layout file which renders my pages, which are templates. In one of my pages, I have a side menu and according to the selection in this menu, I want to load different templates related to this page in this page. How can I achieve this? 回答1: I have done a similar thing using iron-router's layout template option. Say I want to create a home view with multiple views/templates inside of this home view that will change. First I would declare my

How to pass a parameter to pathFor in Handlebars for Iron-Router with Meteorite?

守給你的承諾、 提交于 2019-12-18 10:09:17
问题 I have a simple route with a parameter: this.route('article', { path: '/article/:_id', data: function() { return Articles.findOne(this.params._id); } }); I would like to have use the pathFor handlebars helper here with the _id: {{#each articles}} <li><a href="{{pathFor 'article' _id}}">{{title}}</a></li> {{/each}} This doesnt work for passing the _id tag into the url though... 回答1: <li><a href="{{pathFor 'article' _id=this._id }}">{{title}}</a></li> Thats how you pass a parameter 回答2: In your

Meteor: iron-router => waitOn without subscribe

懵懂的女人 提交于 2019-12-18 05:16:14
问题 i want a loading template to appear before the site has all data to be rendered. And after the serverside Method gives me the Data(from an API [async]) via Meteor.call i want to load the correct layout. I tried many ways found on Google which describe similar but not exatcly the same problem. Including the way to define a function with ready handle, also doesn´t work. I can´t get it running. i don´t want to use Collections because this is user specific Data.( i think this is not efficient to

How to check for Route through route name in template with Meteor and Iron Router

南楼画角 提交于 2019-12-17 23:44:22
问题 What can I use in a template to figure out the route name that is associated with the route that I am currently on? For example if I configured a route like so in iron-router this.route('quick', { path: '/wow/:_id', template: 'create_question' }); So if I am on the route /wow/123 how can I get the router's name in my template, in this case how can I get quick in my template? I'm simply looking for a function, I am sure I can use a handlebars helper to get the rest done. I just need a function

Using Iron Router to waitOn subscription that's dependent on data from a doc that will come from another subscription

微笑、不失礼 提交于 2019-12-17 19:39:53
问题 I'm having trouble configuring the waitOn portion of a route where one of the subscription's parameters is determined by the value from a doc that comes from a different subscription. The collections in play are Candidates and Interviews. An interview will have one and only one candidate. Here's some sample data: candidate = { _id: 1 firstName: 'Some', lastName: 'Developer' //other props }; interview = { _id: 1, candidateId: 1 //other props }; The route is configured as follows. this.route(