user391986
user391986

Reputation: 30886

emberjs dynamic routing, serialize giving Uncaught TypeError: Cannot call method 'get' of undefined

Why is an error thrown inside the serialize function line id = context.get('id'); Specifically why is it even attempting to run the serialize when I load the index route.

full demo: http://jsfiddle.net/mh8Xu/1/

   serialize: function(router, context) {
                    var rtnVal = {},
                        id = context.get('id');
                    if (context) {
                        rtnVal = {post_id: id};
                    }

                    return rtnVal;
                }

Upvotes: 1

Views: 594

Answers (1)

sly7_7
sly7_7

Reputation: 12011

The error is in {{action goToShowPost context="post" href="false"}}. I believed it was backward compatible, but seems it's not. Now you have to directly pass the context, like this:

{{action goToShowPost post href="false"}}

Upvotes: 2

Related Questions