flow-router

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 to make FlowRouter wait for users collection on the client

一个人想着一个人 提交于 2020-01-15 03:56:11
问题 I'm writing a section of my app which requires the user to have the 'operator' role. I'm checking for this in FlowRouter's triggersEnter function. I want that the user which doesn't have the operator role to be shown a restricted access page. I use FlowRouter, Roles and brettle:accounts-deluxe which auto logs in as guest every visitor. Here is my code, routes.js : FlowRouter.route('/switchboard', { name: 'switchboard', triggersEnter: [function (context, redirect, stop) { if (!Roles

A good way to define default rendering templates in FlowRouter

廉价感情. 提交于 2020-01-03 18:58:57
问题 When migrating to a new Meteor project which was replacing Iron-Router with Flow-Router, I really missed the functionality of Iron-Router to define default behaviours and settings that were usable globally. I understand Flow-Router uses the "group" construct to be able to define default hook events which can be applied to any route attached to that group, but there seemed to be nothing available for defining default templates. What is the best way to implement this type of default global or

How to prevent local Flow-Router action function overwriting group defined element

有些话、适合烂在心里 提交于 2020-01-03 05:52:13
问题 I have a Flow-Router group definitions similar to: var myRouteGroup = FlowRouter.group({ name: "myGroupName", prefix: "/myPrefix", // Using arbitrary element to pass group wide defaults defaultGroupSettings: {item1: "value1", item2: "value2"}; }); I than define a route in that group: myRouteGroup.route("/home",{ name: "myRoute", triggersEnter: [ /*...*/ ], action: function () { // Get the arbitrary settings object from group definition var settings = this.group.options.defaultGroupSettings; /

Meteor Routing Error : There is no route for the path: /

故事扮演 提交于 2019-12-24 02:59:09
问题 I have updated Meteor to Meteor 1.3.2.4. and facing the issue. I have also updated all the packages in their latest version. Error : There is no route for the path: / I tried the both in both environment " meteor " and " meteor run --production " the same error will displayed in console. I have installed the following packages. accounts-oauth 1.1.12 Common code for OAuth-based login services accounts-password 1.1.8 Password support for accounts autopublish 1.0.7 (For prototyping only) Publish

Access parent template data with Flow Router

半腔热情 提交于 2019-12-23 22:16:13
问题 I switched to Flow Router and I have a problem. how can I access the parent template data? with Iron Router the data was coming from router and was available inside the template, so if I wanted to access a parent data Template.parentData() was working. But in Flow Router the data is not coming from router, it comes from helpers and Template.parentData() doesn't have the data in it anymore! <template name="myTemplate"> {{#if Template.subscriptionsReady}} {{> showPost parentPost }} {{> newPost

How can I make Meteor templates available to targeted audiences via an URL?

 ̄綄美尐妖づ 提交于 2019-12-12 05:42:06
问题 I want to build a Blog, of sorts, with Meteor but, rather than just have a Blog such as platypus.meteor.com, I want to create a separate Meteor template for each Blog "post" and then send a link to select people such as "platypus.meteor.com/thispost" In this way, the person would only see the post I intend them to see; to see others, they would have to guess at other values, such as "/thatpost", "/theotherpost" etc. And in my case, if they stumbled across them, no big deal. This is my plan:

Inconsistent updating of Meteor template

送分小仙女□ 提交于 2019-12-12 04:36:30
问题 Using Meteor with blaze templates and flow router, I find that if I create a new element then the page doesn't update to show it, but if I delete the same element it disappears immediately. Here's the template code: <template name="EditProject"> ... {{#each currentCounts }} <div class="count-box">{{> CountDelete }}</div> {{/each}} ... <btn class="btn waves-effect waves-light h-button" id="add-count">Add Count</btn> ... </template> <template name="CountDelete"> <div class="card blue-grey

Meteor: There is no route for the path error. how to access SINGLE article within a nested object

妖精的绣舞 提交于 2019-12-12 03:39:11
问题 I have an array of 10 objects 'categories' and each category has sub objects such as posts within that category. This is how it looks. I access the category list like this. <template name="CategoriesMain"> {{#each articles}} <li> <a href="/unfiltered/{{_id}}"><h2>{{name}}</h2></a> </li> {{/each}} </ul> </template> this link <a href="/unfiltered/{{_id}}"><h2>{{name}}</h2></a> accesses the 'posts' list within the category which looks like this <template name="CategoriesSingle"> <h1>This is a

Google map for meteor

☆樱花仙子☆ 提交于 2019-12-11 06:20:09
问题 I install "meteor add dburles:google-maps" in Meteor. I added this code to the React Component, ... import { GoogleMaps } from 'meteor/dburles:google-maps'; ... export default class Location extends TrackerReact(React.Component){ constructor(props) { super(props); this.state = { ... }; GoogleMaps.load(); } componentDidUpdate(){ GoogleMaps.create({ name: 'exampleMap', element: document.getElementById('basic_map'), options: { center: new google.maps.LatLng(-37.8136, 144.9631), zoom: 8 } }); }