I am generating urls as
{{#each Em.subNav.options}}
<li {{bindAttr class="isActive:active"}}>
{{#if isActive}}
<div class="active"><a {{bindAttr href="href"}}>{{label}}</a></div>
{{else}}
<a {{bindAttr href="href"}}>{{label}}</a>
{{/if}}
</li>
{{/each}}
And i would like to have these <a>
tags to cause pushstate changes rather than cause the page to reload. I have been using ember-routemanager to get the pushstate working and had a click handler setup in the view as:
didInsertElement: function() {
logger.info("Setting up click handler for appropriate usage of pushstate");
$('a[href^="/"]').click(function(evt) {
evt.preventDefault();
logger.info("Clicked: %@".fmt($(this).attr('href')));
window.Dashboard.get('routeManager').set('location', $(this).attr('href').replace(/^\//, ""));
});
},
The problem is that this works good for one click and then the click handler seems to go missing ie causes the browser to handle the <a>
tag as a regular one cause the whole page to reload.
Any know issues/workaround/suggestions?