javascript - AngularJS + SPA - 更改布局

标签 javascript c# angularjs twitter-bootstrap single-page-application

我使用 AngularJS 构建了一个 SPA。我想要页面和管理仪表板有两种不同的布局。

我当前的index.html 看起来像这样

    <!DOCTYPE html>
<html data-ng-app="AngularApp">
<head>
....
</head>
<body>
<div>
//some code for navbar and others stuff that doesn't change
</div>
    <div data-ng-view="">
//here are loaded all the content
    </div>

我想做一个具有不同内容和导航栏的不同页面供管理员使用。 如何切换到具有不同 css、js 等的完全不同的布局。 基本上是第二个index-admin.html,它将加载 Angular 、 Bootstrap 、js、css 以及从顶部开始的所有内容 有任何想法吗? 像这样设置路由

    .when("/admin", {
        controller: "adminController",
        templateUrl: "/app/admin/views/index.html"
    });

将内容加载到

 <div data-ng-view=""></div>

我不想要

最佳答案

看看https://github.com/angular-ui/ui-router

支持嵌套 View ,允许您为管理员用户提供具有不同布局的基本 View

关于javascript - AngularJS + SPA - 更改布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27696713/

相关文章:

javascript - 尝试使用克隆 - jQuery

javascript - 如何让 Twitter Bootstrap Popover 保持打开状态,直到鼠标移入其中?

javascript - AngularJs 代码组织 nuget 包

c# - DataGridView 列不是从自定义数据源生成的

javascript - 使用正则表达式在较大字符串的开头查找字符串模式?

c# - 在 C# 上使用多线程的问题

c# - 在 64 位处理器上为 3 Point 结构分配了多少字节?

javascript - 是 ng-repeat 和 ngInclude 的错误吗?

javascript - Angular : Getting Error on adding $scope in factory-service

javascript - 如何从另一个 Controller 更新 Controller 的 ng-repeat 模型?