AngularJS加载页面到一个div [英] AngularJS Loading a page into a div

查看:98
本文介绍了AngularJS加载页面到一个div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有内容的几个静态的HTML页面。我想让它有两个div的一对工具栏菜单和一个容纳内容的索引页。当点击侧边栏的菜单链接之一,我想要加载其他静态的HTML页面到内容DIV之一。

I have a few static html pages of content. I want to make an index page that has two div's One for a sidebar menu and one to hold content. When one of the menu links in the sidebar is clicked I want to load one of the other static html pages into the content div.

我只是不能发现,展示了如何做到这一点的任何文档,所以我甚至不知道这是否是可能的。谁能帮助?

I just cant find any documentation that shows how to do this, so i'm not even sure if it's possible. Can anyone help?

推荐答案

您还可以使用NG-视图设置的路线,将你的模板加载到您的股利。这是pretty直线前进,并有一个很好的例子@ 的https://docs.angularjs .ORG / API / ngRoute /指令/ ngView

You can also use ng-view to setup routes that will load your templates into your div. It's pretty straight forward, and there's a good example @ https://docs.angularjs.org/api/ngRoute/directive/ngView

这篇关于AngularJS加载页面到一个div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆