Angular and Router - unexpected page refresh -
was struggling until realised if bind click event method not exist in component, angular refreshes page. think because of routerlink
, because if remove it, expected error method checkuser() not exist
. why happens?
<a md-button routerlink="articles" routerlinkactive="menu-active" (click)="checkuser()" >articles</a>
the routerlink
directive applied a
element sets href
attribute upon element.
i guess same exception thrown on click event still bubbles , default behavior executed , page location changed. happens fast, don't notice error.
try preserving console logs after page relaod, error should there.
Comments
Post a Comment