[英]With the click of an HTML button, how to INVOKE a java method AND REDIRECT to another HTML page?
[英]How to redirect to another HTML page by button click in a single page app using angular?
我正在開發一個包含登錄和注冊以及其他一些功能的單頁應用程序。我有包含signin.html
和register.html
頁面index.html
,並且register.html
的提交應該將用戶引導到welcome.html
. 我了解如何使用ng-include
將多個 html 頁面放入一個頁面,但是在這種情況下我該如何使用它?
試試include.html
<body ng-app="myApp">
<div >
<div ng-include = "'tryinclude1.html'"></div>
</div>
嘗試包含1.html
<body>
<label>you are in tryinclude1 press ok to go to another page</label>
<button ng-include="'tryinclude1.html'">ok</button>
</body>
tryinclude2.html:
<body>
<label>you are in tryinclude2 press ok to go to another page</label>
<button ng-include="'tryinclude1.html'">ok</button>
</body>
感謝您的幫助
答案是使用 ng-hide 和 ng-show ,不需要路由。 更多細節在這里https://scotch.io/tutorials/how-to-use-ngshow-and-nghide
您可以使用 ng-view 和 ng-route 來管理您的單頁應用程序。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.