Skip to main content

Posts

Showing posts from June, 2018

Disable html5 mode in angular for individual link

In Angular, if we enable the html5 mode,    all href's on the page w ill try to use the html5mode and use the route provider to determine which view should be loaded. In reality, we may need to enable html5 mode on the page but for certain links we want the browser to navigate to the link directly. In HTML5 mode, there are three situations in which the A tag is not rewritten: from the  angular docs Links that contain a  target  attribute. Example:  <a href="/ext/link?a=b" target="_self">link</a> Absolute links that point to a different domain  Example: <a href="http://angularjs.org/">link</a> Links starting with '/' that lead to a different base path when  base  is defined  Example: <a href="/not-my-base/link">link</a>