### File

`src/app/layout/layout.component.ts`

### Implements

`OnInit`

### Metadata

selector | `app-layout`
styleUrls | `layout.component.scss`
templateUrl | `./layout.component.html`

### Index

###### Properties
Public router
###### Methods
ngOnInit

### Constructor

`constructor(router: Router)`
Defined in src/app/layout/layout.component.ts:9
Parameters :
Name | Type | Optional | Description
router | `Router` |  |

### Methods

ngOnInit
`ngOnInit()`
Defined in src/app/layout/layout.component.ts:13
Returns : `void`

### Properties

Public router
`router: `Router``
Type : `Router`
Defined in src/app/layout/layout.component.ts:11

    import { Component, OnInit } from '@angular/core';
    import { Router } from '@angular/router';

    @Component({
        selector: 'app-layout',
        templateUrl: './layout.component.html',
        styleUrls: ['./layout.component.scss']
    })
    export class LayoutComponent implements OnInit {

        constructor(public router: Router) { }

        ngOnInit() {
            if (this.router.url === '/') {
                this.router.navigate(['/dashboard']);
            }
        }

    }

    <app-header></app-header>
    <app-sidebar></app-sidebar>
    <section class="main-container margin-responsive">
        <router-outlet></router-outlet>
    </section>
    <app-footer></app-footer>

Legend
Html element
Component
Html element with directive

# results matching ""

# No results matching ""