meteor-helper

Getting Exception in template helper: quickFormContext with aldeed:autoform

孤者浪人 提交于 2020-01-06 16:19:45
问题 I'm having an issue with aldeed:autoform which I can't solve, nor understand what is the cause. The template: <template name="staffCaseEdit"> {{> quickForm collection=Cases id="inserNewItem" type="insert"}} </template> I use aldeed:collection2 and aldeed:simple-schema to manage collections. So, I have the Case schema and Cases collection, both defined in /lib so they should be available on the client side, too. Next, there's the route: FlowRouter.route('/staff/case/:id', { triggersEnter: [

Meteor Reactive Table Helper Arguments

对着背影说爱祢 提交于 2020-01-06 09:03:26
问题 Using the latest version of Meteor with aslagle:reactive-table. In Iron Router, I can pass a data context to my template: router.js: Router.route('/dates', { name: 'dates', data: { header_title: 'Dates & Times' } }); dates.html: <div class="bt-h1">{{header_title}}</div> Can I do something similar with ReactiveTables, i.e. pass "variable" from router.js? {{> reactiveTable collection=tests settings=variable}} 来源: https://stackoverflow.com/questions/28732955/meteor-reactive-table-helper

Two ways to define helpers in Meteor

馋奶兔 提交于 2020-01-04 05:15:36
问题 EDIT: This is no longer relevant in Meteor 1.0. The first syntax has been deprecated, and only the second is supported. It seems that there are two ways to define what are apparently called helpers in Meteor: Template.foo.helper1 = function() { ... } Other way: Template.foo.helpers({ helper2: function() { ... } }); Is there any semantic or usage difference between the two? The only restriction I can see is that the first usage can't use reserved keywords. I'm wondering if the distinction

How do I indicate 'checked' or 'selected' state for input controls in Meteor (with spacebars templates)?

半腔热情 提交于 2020-01-03 18:48:28
问题 So I'm trying to be efficient and clean in my Spacebars templates as I work with Meteor. But I'm stumped by the way in which checkboxes and select options are to be dealt with. Suppose I want to have a checkbox set as checked or not depending on a flag that is in a document in one of my collections. I don't appear to be able to do the following: <input type='checkbox' id='item-{{this.item_id}}' {{#if checked}}checked{{/if}} /> When I try this, I get the following error: A template tag of type

How do I indicate 'checked' or 'selected' state for input controls in Meteor (with spacebars templates)?

淺唱寂寞╮ 提交于 2020-01-03 18:46:11
问题 So I'm trying to be efficient and clean in my Spacebars templates as I work with Meteor. But I'm stumped by the way in which checkboxes and select options are to be dealt with. Suppose I want to have a checkbox set as checked or not depending on a flag that is in a document in one of my collections. I don't appear to be able to do the following: <input type='checkbox' id='item-{{this.item_id}}' {{#if checked}}checked{{/if}} /> When I try this, I get the following error: A template tag of type

Meteor: Accounts.createUser() doesn't create user

好久不见. 提交于 2020-01-03 03:14:06
问题 i'm building an application where people Can't create their account by themselves but the first user created (me) can create users in a form in the application. It's why I setted in /lib/config/account.js: forbidClientAccountCreation: true, My problem is, I can't create users in my form when I'm logged .. (even if I set this option above with false. Here is my code: userAdd.js: Template.userAdd.events({ 'submit .new-user': function(event) { event.preventDefault(); var email = $('input[name=

Filtering records according to dropdownlist

老子叫甜甜 提交于 2019-12-24 15:32:49
问题 I need to filter the listing or records according to selection in dropdownlists. I have three dropdowns that needs to filter the records reactively in collaboration with each other. i.e value selection in one dropdownlist should filter the records effected by other dropdownlist values. var filterAndLimitResults = function (cursor) { if (!cursor) { return []; } var raw = cursor.fetch(); var currentChosenCategory = chosenCategory.get(); var currentChosenCity = chosenCity.get(); var currentJtype

Is there a way to access Iron Router parameter from template in Meteor

≯℡__Kan透↙ 提交于 2019-12-24 14:24:26
问题 I have a route that has a parameter in it and I need to access it from many different templates. Below is one example of the route, there are several routes that are very similar just after the _occasionnId parameter it changes: For example: Route 1: /occasions/:_occasionId/cards/ Router 2: /occasions/:_occasionId/tables/ Here is my full code for each route, the only thing that really changes is the route path and the template. Router.route('/occasions/:_occasionId/cards/', { template: 'cards

Meteor helpers not available in Angular template

空扰寡人 提交于 2019-12-24 03:30:00
问题 I am learning Meteor and I'm trying to add internationalization support with the tap:18n package. Unfortunately, the template helper function _ is not availble inside Angular modules. For example <div>{{_ "foo"}}</div> works, but does not when using it inside a module template : > index.html <div ng-app="app" ng-include="'foo.ng.html'"> > foo.ng.html <div ng-app="bar"> <div>{{_ "bar"}}</div> </div> note: app is declared inside foo.js as angular.module('app', ['angular-meteor']); , in the

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