Meteor Iron Router : Passing data between routes

前端 未结 2 1356
暗喜
暗喜 2021-02-08 00:34

How do I pass data between two different routes and templates?

I have a javascript file on the front end (client folder) that simply calls Router.go() passing in the po

相关标签:
2条回答
  • 2021-02-08 00:50

    Looks like you found the answer / resolved this, but just in case, I think it's in your findOne statement:

    data: function() {          
            return POLL.findOne(this.params._PostId); 
        },
    

    should read:

    data: function() {          
            return POLL.findOne({_id:this.params._PostId}); 
        },
    

    (assuming that POLL has your posts listed by _id.

    Hope that helps.

    0 讨论(0)
  • 2021-02-08 00:51

    Could you pass the info in the Session? the docs for that are here http://docs.meteor.com/#session. That's what I'm planning on doing.

    0 讨论(0)
提交回复
热议问题