我有一個項目的角度,每次你點擊一個標籤href =「#」,它被重定向到項目的開始。當你點擊帶有href =「#」的標籤時,不要重定向,也不會發生任何事情。我不想使用event.prevent或類似的東西,因爲那麼我應該把它放在每個HTML標籤上。 點擊帶有href =「#」的標籤時不重定向。 Angular.js
<script type="text/ng-template" id="views/login.html">
<h1>view with my problem</h1>
this link has href='#'. I need stop redirecting..
Without using something 'event.prevent' like this because I do not want to do it every time
<br>
<a href="#">NOT REDIRECT!</a>
</script>
https://jsfiddle.net/0hdcb3dr/
我希望你找到的href = '#' 任何部位,不要重定向到默認模板($ urlRouterProvider.otherwise( '/'));不應該重定向,但我不想每次使用$ event.prevent或類似的東西時,我發現自己href ='#' 在一個真正的項目中,我到處都有href ='#',我不想修復它逐個。
是否必須是''?它不能是'
那麼該鏈接應該做什麼? – Maccurt
@MatiasCicero https://jsfiddle.net/33ujw8gj/ – yavg