This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from '@angular/core'; | |
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http'; | |
import {Observable} from 'rxjs/Observable'; | |
import {environment} from '../../../environments/environment'; | |
@Injectable() | |
export class EnvironmentInterceptorService implements HttpInterceptor { | |
constructor() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from '@angular/core'; | |
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http'; | |
import {Observable} from 'rxjs/Observable'; | |
import {AuthService} from '../services/auth.service'; | |
@Injectable() | |
export class TokenInterceptor implements HttpInterceptor { | |
constructor(private auth: AuthService) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'rxjs/add/operator/do'; | |
import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpResponse} from '@angular/common/http'; | |
import {Injectable} from '@angular/core'; | |
import {Observable} from 'rxjs/Observable'; | |
import {Router} from '@angular/router'; | |
@Injectable() | |
export class StatusInterceptor implements HttpInterceptor { | |
constructor(private router: Router) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {NgModule} from '@angular/core'; | |
import {CommonModule} from '@angular/common'; | |
import {LoaderComponent} from './loader/loader.component'; | |
import {LoaderService} from './loader.service'; | |
@NgModule({ | |
imports: [ | |
CommonModule | |
], | |
declarations: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="preloader"> | |
<div class="loader"></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.preloader { | |
z-index: 2; | |
background-color: #fff; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
&.global { | |
position: fixed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { BehaviorSubject } from 'rxjs/BehaviorSubject'; | |
import { Loader } from './loader.model'; | |
@Injectable() | |
export class LoaderService { | |
private loader = new BehaviorSubject<Loader>({id: 'global', status: false}); | |
loaderStatus$ = this.loader.asObservable(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, Input, OnInit} from '@angular/core'; | |
import {LoaderService} from '../loader.service'; | |
import {Loader} from '../loader.model'; | |
@Component({ | |
selector: 'app-loader', | |
templateUrl: './loader.component.html', | |
styleUrls: ['./loader.component.scss'] | |
}) | |
export class LoaderComponent implements OnInit { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { HttpClientModule, HttpClient } from '@angular/common/http'; | |
import { BrowserModule } from '@angular/platform-browser'; | |
import { TranslateModule, TranslateLoader } from '@ngx-translate/core'; | |
import { TranslateHttpLoader } from '@ngx-translate/http-loader'; | |
import { AppComponent } from './app.component'; | |
export function HttpLoaderFactory(http: HttpClient) { | |
return new TranslateHttpLoader(http); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"validators": { | |
"required": "{{field}} is required!", | |
"email": "E-mail is not valid!", | |
"minlength": "{{field}} should have minimum {{length}} characters!", | |
"maxlength": "{{field}} should have maximum {{length}} characters!", | |
"min": "{{field}} minimum values is {{value}}!", | |
"max": "{{field}} maximum values is {{value}}!", | |
"pattern": "{{field}} have incorrect format!", | |
"customValidation": "Here will be custom message for your custom validation." |
OlderNewer