i am currently experimenting with angular2 (beta1) and i'm a bit puzzled about the new router.
Navigating via router.navigate works like a charm, while trying to do that via a normal link to a registered route refreshes the page. This happens with PathLocationStrategy of course, as HashLocationStrategy works as expected.
Is this a bug or the normal behaviour?
TIA
You can try passing the json in the html template on routerLink like this.
If you have array of link you can still try something like this with *ngFor
You should use a
routerLink
instead. For example<a [routerLink]="[ '/MyCmp', {myParam: 'value' } ]">
See also https://angular.io/guide/ajs-quick-reference#ng-href
You could add event listeners to the
<a href=...
elements or a parent and callrouter.navigate...
andevent.preventDefault()
.