src/app/app.component.ts
providers |
{
provide: TooltipConfig, useFactory: (): TooltipConfig => Object.assign(new TooltipConfig(), {
container:
})
}
|
selector | cd-root |
styleUrls | ./app.component.scss |
templateUrl | ./app.component.html |
Properties |
Methods |
constructor(authStorageService: AuthStorageService, router: Router, toastr: ToastsManager, vcr: ViewContainerRef)
|
|||||||||||||||
Defined in src/app/app.component.ts:24
|
|||||||||||||||
Parameters :
|
isDashboardPage |
isDashboardPage()
|
Defined in src/app/app.component.ts:39
|
Returns :
boolean
|
isLoginActive |
isLoginActive()
|
Defined in src/app/app.component.ts:35
|
Returns :
boolean
|
title |
Type : string
|
Default value : 'cd'
|
Defined in src/app/app.component.ts:24
|
Public toastr |
Type : ToastsManager
|
Defined in src/app/app.component.ts:29
|
import { Component, ViewContainerRef } from '@angular/core';
import { Router } from '@angular/router';
import { ToastsManager } from 'ng2-toastr';
import { TooltipConfig } from 'ngx-bootstrap/tooltip';
import { AuthStorageService } from './shared/services/auth-storage.service';
@Component({
selector: 'cd-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
providers: [
{
provide: TooltipConfig,
useFactory: (): TooltipConfig =>
Object.assign(new TooltipConfig(), {
container: 'body'
})
}
]
})
export class AppComponent {
title = 'cd';
constructor(
private authStorageService: AuthStorageService,
private router: Router,
public toastr: ToastsManager,
private vcr: ViewContainerRef
) {
this.toastr.setRootViewContainerRef(this.vcr);
}
isLoginActive() {
return this.router.url === '/login' || !this.authStorageService.isLoggedIn();
}
isDashboardPage() {
return this.router.url === '/dashboard';
}
}
<block-ui>
<cd-navigation *ngIf="!isLoginActive()"></cd-navigation>
<div class="container-fluid"
[ngClass]="{'full-height':isLoginActive(), 'dashboard':isDashboardPage()} ">
<cd-breadcrumbs></cd-breadcrumbs>
<router-outlet></router-outlet>
</div>
<block-ui>
./app.component.scss
@import '../defaults';
.dashboard {
background-color: $color-whitesmoke-gray;
margin: 0;
padding: 0;
}
::ng-deep #toast-container {
margin-top: 2vw;
@media (max-width: 1600px) {
margin-top: 2.5vw;
}
@media (max-width: $screen-sm-max) {
margin-top: 9vw;
}
@media (max-width: 900px) {
margin-top: 10vw;
}
@media (max-width: 319px) {
margin-top: 11vw;
}
@media (max-width: 260px) {
margin-top: 14vw;
}
}