Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么对Meteor.Router使用嵌套url会阻止模板呈现?_Meteor - Fatal编程技术网

为什么对Meteor.Router使用嵌套url会阻止模板呈现?

为什么对Meteor.Router使用嵌套url会阻止模板呈现?,meteor,Meteor,我正在使用Meteor的路由器包,当我尝试在/createGroupURL下呈现groupCreate模板时,一切正常,如下所示: Meteor.Router.add({ "/createGroup": { to: "groupCreate", and: function() { return Session.set("currentGroupId", null); } } }); 但是,当我尝试使用嵌套URL(如/groups/create)而不

我正在使用Meteor的路由器包,当我尝试在
/createGroup
URL下呈现
groupCreate
模板时,一切正常,如下所示:

Meteor.Router.add({
  "/createGroup": {
    to: "groupCreate",
    and: function() {
       return Session.set("currentGroupId", null);
    }
  }
});

但是,当我尝试使用嵌套URL(如
/groups/create
)而不是
/createGroup
)时,不会绘制模板。我想知道为什么。嵌套URL是否具有特殊的语义?

嵌套路由对我来说很好。问题可能出现在代码中的其他地方,比如行为不正常的过滤器或其他东西。任何过滤器中都没有提到模板。正如我所说,我所做的唯一更改是:我将URL从
createGroup
更改为
groups/create
。Meteor.Router不推荐使用。标准路由器包现在是IronRouter。