如何在没有 ng-include 的情况下向 AngularJS 模板添加导航侧边栏和页脚。?
How to add a navigation sidebar and a footer to an AngularJS template without ng-include.?
我是 angular 开发的新手。我一直在使用一些付费 angular 管理主题。在所有这些中,开发人员仅将 ng-view
和 ng-class
属性添加到 index.html
。我只想知道如何在不使用任何 ng-include
.
的情况下向每个页面添加侧边栏导航和页脚
如果你不想使用ng-include
,你可以将你的HTML直接放在index.html
中。这称为 layout template,它是包含应用程序中常见元素的视图。
总而言之,ng-view
元素之外的 index.html
中的所有内容都会出现在每个页面中(只要您使用 angular-route
等任何模块在同一页面内进行路由原始 HTML 文档(例如 index.html
))。
我会推荐你关注官方AngularJS tutorial if you are new to this framework. Also, ng-book by Ari Lerner 是关于这个主题的必读
我是 angular 开发的新手。我一直在使用一些付费 angular 管理主题。在所有这些中,开发人员仅将 ng-view
和 ng-class
属性添加到 index.html
。我只想知道如何在不使用任何 ng-include
.
如果你不想使用ng-include
,你可以将你的HTML直接放在index.html
中。这称为 layout template,它是包含应用程序中常见元素的视图。
总而言之,ng-view
元素之外的 index.html
中的所有内容都会出现在每个页面中(只要您使用 angular-route
等任何模块在同一页面内进行路由原始 HTML 文档(例如 index.html
))。
我会推荐你关注官方AngularJS tutorial if you are new to this framework. Also, ng-book by Ari Lerner 是关于这个主题的必读