How to use yield and Iron-router?

☆樱花仙子☆ 提交于 2019-12-02 10:10:32
httpNick

I figured out the answer to my own question after searching around stackoverflow at other iron-router questions.. I have no idea why it worked, but it solved the issue. All I had to do was run:

meteor add ejson

and I no longer got my error.

Here is the question that answered my question (which was posted AFTER my question): Iron:router 1.0.9 Not working

The exception isn't very relevant, but I see two possibilities:

  • You forgot the template attribute in your Route.route();
  • Your router configuration file isn't in the right folder

For the first one:

Router.route("/", {
    name : "homeIndex",
    template : "homeIndex",
    data : function() {
        return {
            message : "Welcome to the Rocket Shop"
        }
    }
});

For the second one: make sure your router.js file is in client/lib/ folder.

Also, make sure that you have the iron-router package in the .meteor/packages.js file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!