Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 在角2中显示部件时,如何旁路routher插座?_Angular_Angular5 - Fatal编程技术网

Angular 在角2中显示部件时,如何旁路routher插座?

Angular 在角2中显示部件时,如何旁路routher插座?,angular,angular5,Angular,Angular5,我是angular 2的新广告人。这可能是一个非常基本的问题,但我有仪表板页面和登录页面。仪表板页面有一个标题页和菜单,登录页面是带有登录表单的完整登录页面。我的问题是: 当显示登录页面时,它会显示仪表板标题菜单,因为我在路由器出口和登录应用之前设置了应用程序标题。是否可以在显示登录页面之前绕过仪表板元素? app.component.html 而login.component.html只是登录表单 和header.component.html 但它是这样表现的 提前感谢。从app.compo

我是angular 2的新广告人。这可能是一个非常基本的问题,但我有仪表板页面和登录页面。仪表板页面有一个标题页和菜单,登录页面是带有登录表单的完整登录页面。我的问题是: 当显示登录页面时,它会显示仪表板标题菜单,因为我在路由器出口和登录应用之前设置了应用程序标题。是否可以在显示登录页面之前绕过仪表板元素? app.component.html

而login.component.html只是登录表单 和header.component.html

但它是这样表现的
提前感谢。

从app.component.html中删除app header组件并将其放置在dashboard.component.html中。app.component.html应该只有rouert插座

app.component.html

dashboard.component.html


从app.component.html中删除并将其放置在dashboard.component.html中。app.component.html应该只有好人!!我是傻瓜。。这很简单。。谢谢。添加评论作为回答。你可以接受
<header-app></header-app>
<div class="container">
    <router-outlet></router-outlet>
</div>
<nav class="navbar navbar-fixed-top">
<div class="container">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header col-md-8 col-sm-6 col-xs-6">
        <div class="logo">
            <a href="index.html"><img class="img-responsive" src="images/logo.png"></a>
        </div>
        <ul class="navbar-nav">
            <li class="nav-item active">
                <a class="nav-link" routerLink="/Home">Home</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" routerLink="/Login">Login</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" routerLink="/Employee">Employee</a>
            </li>
        </ul>
    </div>
    <div class="text-right col-md-4 col-sm-6 col-xs-6">
        <button class="sign_btn">Sign Up</button>
    </div>
</div>
<router-outlet></router-outlet>
<header-app></header-app>
<other-things></other-things>
...
...
<footer></footer>