我正在构建一个angular2应用程序.
我有一个登录页面 - 只有2个输入(没有标题没有页脚没有侧栏)
当用户登录时,他应该导航到包含页眉,页脚和右侧导航栏的页面.
内页中唯一改变的是右侧内容.
我有app.component
import { Component } from '@angular/core';
import {ViewEncapsulation} from '@angular/core';
@Component({
selector: 'pm-app',
template: `
<div>
<router-outlet></router-outlet>
</div>
`,
styleUrls:["app/app.component.css"],
encapsulation: ViewEncapsulation.None
})
export class AppComponent {
pageTitle: string = 'Acme Product Management';
}
Run Code Online (Sandbox Code Playgroud)
我理解这个app.component就像母版页,您可以在其中添加页眉和页脚, <router-outlet></router-outlet>内容根据路由进行更改.
我的简单问题是如何为登录页面制作一个布局,将页眉,页脚和右栏的另一个布局设置为内页?
在同一个Angular2应用程序中使用两个完全不同的布局的最佳实践方法是什么?例如,在我的/登录路线中,我想要一个非常简单的水平和垂直居中的框,对于每一个其他路线,我想要我的完整模板与标题,内容和页脚.