我想通过点击DescriptionForm.js表单上的按钮,在另一个页面上(在Dashboard.js上)只显示“title”。以下是html代码 -
<li class="abc">
<h3 style="margin-left: 100px;color:orange;">
Title:" {{resultvar.title}}"
<button type="submit" name="submit" id="btn1" class="btn1 btn-warning pull-right">
WIP
</button>
</h3>
</li>
以下是Helper-
Template.Dashboard.helpers({
resultvar:()=> {
var x = FlowRouter.getParam("title");
console.log("hii");
console.log("value of x =" + x);
return BugDetails.findOne({'_id': x});
},});
以下是event-
Template.DescriptionForm.events({
'click .btn-warning': function (e) {
e.preventDefault();
var title = e.target.title.value;
console.log('title:' + title);
console.log("You pressed the WIP button");
FlowRouter.go('/dashboard');
},});
在控制台上,这是我的错误 -
标题:未定义
您按下了WIP按钮
HII
值x =未定义