File

src/app/app.component.ts

Implements

OnInit

Metadata

selector app-root
styleUrls ./app.component.css
templateUrl ./app.component.html

Index

Properties
Methods

Constructor

constructor(router: Router, loader: LoaderStore)
Parameters :
Name Type Optional
router Router No
loader LoaderStore No

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

title
title: string
Type : string
Default value : 'Allied Admin'
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;
  }
}
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""