[英]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.