src/app/app.component.ts
selector | app-root |
styleUrls | ./app.component.css |
templateUrl | ./app.component.html |
Properties |
Methods |
constructor(router: Router, loader: LoaderStore)
|
|||||||||
Defined in src/app/app.component.ts:15
|
|||||||||
Parameters :
|
ngOnInit |
ngOnInit()
|
Defined in src/app/app.component.ts:19
|
Returns :
void
|
title |
title:
|
Type : string
|
Default value : 'Allied Admin'
|
Defined in src/app/app.component.ts:15
|
import { Component, OnInit } from '@angular/core';
import {
RouteConfigLoadEnd,
RouteConfigLoadStart,
Router
} from '@angular/router';
import { LoaderStore } from './modules/loader/loader.store';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'Allied Admin';
constructor(private router: Router, private loader: LoaderStore) { }
ngOnInit() {
this.router.events.subscribe(event => {
if (event instanceof RouteConfigLoadStart) {
this.loader.show();
} else if (event instanceof RouteConfigLoadEnd) {
this.loader.hide();
}
});
}
}
<router-outlet></router-outlet>
<app-loader></app-loader>
./app.component.css
@media (max-width: 767px) {
/* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */
.body-content {
padding-top: 50px;
}
}