Getting started snippet question

Hello all!

I understand that this is a “Practical, answerable question”, and I did post my question on StackOverflow, but there doesn’t seem to be anyone interested or capable of answering it, so I’m taking a chance here, since there seems to be more action here.

I put the getting started snippet here on jsbin.

If I add a hash tag at the end of the URL and navigate there, the content of the page is duplicated/appended at the end of the page. If I then navigate back and forth with the arrow controls of the browsers, the content will be copied again and again. I would like to understand why.

Thanks!

2 Likes

I submitted a pull request to fix the example. Returning a model in the application route is causing a re-render. It’s better to use IndexRoute instead of ApplicationRoute.

Should the Index template in your pull request have the data-template-name attribute to give it a name instead of the id attribute? Or is it the same thing underneath?

They both work. The guides use data-template-name, but @tom’s screen cast uses id. I don’t know if one is preferred over the other.