You can completely disable layout components to create custom page layout like Login and Register pages.
First you will need to import LayoutService and subscribe to isCustomLayout in the main app component:
import { Component, OnInit } from '@angular/core';
import { LayoutService } from '../../../src';
@Component({
selector: 'app-root',
templateUrl: './app.component.html'
})
export class AppComponent implements OnInit {
public isCustomLayout: boolean;
constructor(
private layoutService: LayoutService
) {}
ngOnInit() {
this.layoutService.isCustomLayout.subscribe((value: boolean) => {
this.isCustomLayout = value;
});
}
}
Wrap the main component html like so:
<ng-container *ngIf="isCustomLayout else noCustomLayout">
<router-outlet></router-outlet>
</ng-container>
<ng-template #layoutEnabled>
<mk-layout-wrapper>
...
</mk-layout-wrapper>
<ng-template>
Configure the router:
...
, {
path: 'login',
loadChildren: 'app/login/login.module#LoginModule',
data: {
customLayout: true
}
},
...