The problem is, my helpers don’t give any result that I expect and I don’t know why. I am a beginner and have already spent a pair of hours figuring out why this can happen. I didn’t find any problem alike in the internet and now I am already asking for help
Hy helper in /client/myapp.js
Template.anfang.helpers({
evaluierungen: function(){
Evaluierungen.find();
}
});
My Iron Router: in /lib/router.js
Router.configure({
layoutTemplate: 'layout',
loadingTemplate: 'loading',
waitOn: function(){
return Meteor.subscribe('evaluierungen');
}
});
Router.map(function(){
this.route('anfang', {path: '/',}),
this.route('admin'),
this.route('erstelleEvaluierung', {path: '/admin/evals/new'}),
this.route('bearbeiteEvaluierung', {
path: '/admin/evals/:_id',
data: function(){ return Evaluierungen.findOne(this.params._id); },
}),
this.route('evaluieren', {
path: '/eval/:_id',
data: function(){ return Evaluierungen.findOne(this.params._id); },
})
})
My /client/anfang.html:
<template name="anfang">
<div class="container">
<div class="row">
<div class="col-xs-12"><br>
<select id="eval">
{{#each evaluierung in evaluierungen}}
<option value="{{_id}}">{{titel}}</option>
{{/each}}
</select><br>
<label for="password">Password</label>
<input id="password" type="text"><br>
<input type="submit" value="Anfangen">
</div>
</div>
</div>
</template>
Somehow I don’t have any options for select. But then I can have data for it in the console:
> var o = Evaluierungen.find().fetch();
< undefined
> o
< [Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, …] (37) = $4
This problem happens in another one or two of templates as well, but not in all of them. It just drives me crazy already