在用户登录之前,不要在angularjs中显示菜单

时间:2016-11-21 11:51:36

标签: angularjs jsp

我有angularjs申请
在index.jsp中我添加了头文件

<jsp:include page="header.jsp" />
在header.jsp中的

我添加了项目的菜单

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="security"
    uri="http://www.springframework.org/security/tags"%>
<html>
<head>
<title>Master Protection</title>
</head>
<body ng-controller="menubarController as ctrl">
    <div id="parent_vertical">
        <div>
            <div  style="float: left;"><img src="<c:url value="images/others/logo-meesters-300x50.jpg" />"  width="600" height="70" align="top"></div>
            <div ng-show="true" ><textarea class ="messagesGrid" rows="3" cols="50"> {{ctrl.msg}}   </textarea> </div>
        </div>
        <div id="menubarContainer"
            layout="row" ng-cloak>
            <md-toolbar class="md-menu-toolbar">
            <div layout="row" class="menu">
                <div>
                    <md-menu-bar> 
                    <md-menu>
                            <button ng-click="$mdOpenMenu()">Home</button>
                            <md-menu-content> 
                                <md-menu-item> 
                                        <md-button  href="#/">Home</md-button>
                                </md-menu-item>
                            </md-menu-content> 
                        </md-menu>
                        <md-menu>
                            <button ng-click="$mdOpenMenu()">Users</button>
                            <md-menu-content> 
                                <md-menu-item> 
                                        <md-button ng-click="$mdMenu.hide();" href="#/users">Users</md-button>
                                </md-menu-item>
                            </md-menu-content> 
                        </md-menu>
                        <md-menu>
                            <button ng-click="$mdOpenMenu()">Company</button>
                            <md-menu-content> 
                                <md-menu-item> 
                                        <md-button ng-click="$mdMenu.hide();" href="#/companies">Companies</md-button>
                                </md-menu-item>
                            </md-menu-content> 
                        </md-menu>
                        <c:if test="${sessionScope.isAdmin}">
                        <md-menu>
                            <button ng-click="$mdOpenMenu()">Project</button>
                            <md-menu-content> 
                                <md-menu-item> 
                                        <md-button ng-click="$mdMenu.hide();"  href="#/projects">Projects</md-button>
                                </md-menu-item>
                            </md-menu-content> 
                        </md-menu>
                        </c:if>
                        <md-menu>
                            <button ng-click="$mdOpenMenu()">Supplier</button>
                            <md-menu-content> 
                                <md-menu-item> 
                                        <md-button ng-click="$mdMenu.hide();"  href="#/suppliers">Suppliers</md-button>
                                </md-menu-item>
                            </md-menu-content> 
                        </md-menu>
                        <md-menu>
                            <button ng-click="$mdOpenMenu()">Product</button>
                            <md-menu-content> 
                                <md-menu-item> 
                                        <md-button ng-click="$mdMenu.hide();"  href="#/products">Products</md-button>
                                </md-menu-item>
                            </md-menu-content> 
                        </md-menu>
                        <md-menu>
                            <button ng-click="$mdOpenMenu()">System</button>
                            <md-menu-content> 
                                <md-menu-item> 
                                        <md-button ng-click="$mdMenu.hide();"  href="#/systems">System</md-button>
                                </md-menu-item>
                            </md-menu-content> 
                        </md-menu>
                        <md-menu>
                            <button ng-click="$mdOpenMenu()">Fire Protection</button>
                            <md-menu-content> 
                                <md-menu-item> 
                                        <md-button ng-click="$mdMenu.hide();"  href="#/fireProtections">Fire Protection</md-button>
                                </md-menu-item>
                            </md-menu-content> 
                        </md-menu>                        
                    </md-menu-bar>
                </div>
            </div>
            </md-toolbar>
        </div>
    </div>
</body>
</html>

我的问题是这个header.jsp(菜单和项目徽标)甚至出现在登录页面

我该怎样防止这种情况?

0 个答案:

没有答案