简体   繁体   English

AngularJS 动态添加和删除 HTML

[英]AngularJS Dynamically adding and removing HTML

Hi I'm trying to create a website where depending on what button is pressed, it will load HTML in a container corresponding to that button without having to reload the page.嗨,我正在尝试创建一个网站,根据按下的按钮,它将在与该按钮对应的容器中加载 HTML,而无需重新加载页面。 I was hoping someone could point me in the right direction to where I can learn how to do this.我希望有人可以为我指出正确的方向,让我可以学习如何做到这一点。 Thanks谢谢

This can be done easily with the Angular UI Router.这可以通过 Angular UI Router 轻松完成。

This page has a demo that (I think) does what you want:这个页面有一个演示(我认为)做你想要的:

https://ui-router.github.io/tutorial/ng1/helloworld https://ui-router.github.io/tutorial/ng1/helloworld

There may be some studying required to master this :)掌握这个可能需要一些学习:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM