我想要做一個登錄視圖,但我看到在網絡其餘部分的相同結構,我可以看到菜單和導航欄。如何添加視圖whitout模板?
你能幫我嗎?我怎樣才能在登錄視圖中刪除這些部分?
路線代碼:
'use strict';
angular.module('RDash')
.config(['$stateProvider', '$urlRouterProvider', '$mdDateLocaleProvider', 'calendarConfig', '$breadcrumbProvider',
function($stateProvider, $urlRouterProvider, $mdDateLocaleProvider, calendarConfig, $breadcrumbProvider) {
$breadcrumbProvider.setOptions({
prefixStateName: 'index',
template: 'bootstrap3'
});
// For unmatched routes
$urlRouterProvider.otherwise('/');
// Application routes
$stateProvider
.state('index', {
url: '/login',
templateUrl: 'login.html',
ncyBreadcrumb: {
label: 'Title'
}
})
.state('prueba', {
url: '/prueba',
templateUrl: 'templates/prueba.html',
ncyBreadcrumb: {
label: 'Title'
}
});
}
]);
指數:
<!doctype html>
<html lang="es" ng-app="RDash">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Title</title>
</head>
<body ng-controller="MasterCtrl" class="posicion-menu">
<div id="page-wrapper" ng-class="{'open': toggle}" ng-cloak>
<!-- Sidebar -->
<div id="sidebar-wrapper">
<ul class="sidebar">
<li class="sidebar-main">
<a ng-click="toggleSidebar()">
<!--Dashboard-->
<img class="logo" ng-src="img/logo.png" alt="Title Logo">
<span class="menu-icon glyphicon glyphicon-transfer"></span>
</a>
</li>
<li class="sidebar-list">
<a href="#/section1">Section 1 <span class="menu-icon fa fa-tachometer"></span></a>
</li>
<li class="sidebar-list">
<a href="#/section2">Section 2 <span class="menu-icon fa fa-search"></span></a>
</li>
<li class="sidebar-list">
<a href="#/section3">Section 3 <span class="menu-icon fa fa-file-text-o"></span></a>
</li>
</ul>
</div>
<!-- End Sidebar -->
<div id="content-wrapper">
<div class="page-content">
<!-- Main Content -->
<div ui-view id="contenedor"></div>
</div><!-- End Page Content -->
</div><!-- End Content Wrapper -->
</div><!-- End Page Wrapper -->
</body>
</html>
的login.html是空的。
我需要的登錄視圖是空的,只有白色的登錄表單,其餘的網站白色導航欄和左側的菜單。
在MasterCtrl中檢查$ stateProvider的狀態。如果它處於登錄狀態,請設置模板可用於隱藏或顯示菜單和導航欄組件的標誌。 – Hoyen