File

src/app/app.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Accessors

Constructor

constructor(errorService: ErrorStore, sessionStore: SessionStore, router: Router, sanitizer: DomSanitizer, renderer: Renderer2, plaidService: PlaidService)
Parameters :
Name Type Optional
errorService ErrorStore No
sessionStore SessionStore No
router Router No
sanitizer DomSanitizer No
renderer Renderer2 No
plaidService PlaidService No

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

hidePlaid
Default value : true
styleUrl
Type : SafeUrl

Accessors

onTimeout
getonTimeout()
import 'rxjs/add/operator/filter';

import { Component, OnInit, ViewEncapsulation, Renderer2 } from '@angular/core';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import { Router } from '@angular/router';

import { ErrorStore } from './providers/stores/error.store';
import { SessionStore } from './providers/stores/session.store';
import { PlaidService } from './providers/services/plaid.service';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css'],
  encapsulation: ViewEncapsulation.None,
})
export class AppComponent implements OnInit {
  styleUrl: SafeUrl;
  hidePlaid = true;

  constructor(
    private errorService: ErrorStore,
    private sessionStore: SessionStore,
    private router: Router,
    private sanitizer: DomSanitizer,
    private renderer: Renderer2,
    private plaidService: PlaidService
  ) {}

  ngOnInit(): void {
    this.sessionStore.session$
      .filter((session) => session !== null)
      .filter((session) => session !== undefined)
      .filter((session) => session.styleUrl !== null)
      .filter((session) => session.styleUrl !== undefined)
      .filter((session) => session.styleUrl.length > 0)
      .subscribe((session) => {
        this.styleUrl = this.sanitizer.bypassSecurityTrustResourceUrl(session.styleUrl);
      });
    this.sessionStore.init();
  }

  get onTimeout() {
    return () => {
      // leave arrow fn  () => to ensure this context is correct
      this.errorService.showError('Session Timed Out', 'Redirecting....');
      setTimeout(() => {
        this.router.navigate(['/logout']);
      }, 1000);
    };
  }
}
<link rel="stylesheet" [href]="styleUrl" />
<router-outlet></router-outlet>
<full-page-loader></full-page-loader>
<app-timeout [delegate]="onTimeout"></app-timeout>
<app-version-label></app-version-label>

./app.component.css

Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""