<script src="https://maps.googleapis.com/maps/api/js?key=KEY"></script>declare var google;| export class ValidateEmailNotTaken { | |
| static createValidator(signupService: SignupService) { | |
| return (control: AbstractControl) => { | |
| return signupService.checkEmailNotTaken(control.value).map(res => { | |
| return res ? null : { emailTaken: true }; | |
| }); | |
| }; | |
| } | |
| } |
| import { Injectable } from '@angular/core'; | |
| import { HttpInterceptor, HttpRequest, HttpHandler, HttpEvent } from '@angular/common/http'; | |
| import { Observable } from 'rxjs'; | |
| @Injectable() | |
| export class AuthInterceptor implements HttpInterceptor { | |
| constructor() { } | |
| intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { |
View: https://www.youtube.com/watch?v=t-hZa1mPPN0
map: any;
directionsService = new google.maps.DirectionsService();| import requests | |
| project_id = 'xxxxx' | |
| labels = ['New funcionality', 'Support', 'Maintenance'] | |
| milestone = 'v1.6.0' | |
| state = 'closed' | |
| url = f'https://gitlab.com/api/v4/projects/{project_id}/issues' | |
| headers = {'Authorization': 'Bearer xxxxxxxx'} # https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#limiting-scopes-of-a-personal-access-token |
| server { | |
| listen 80; | |
| location / { | |
| root /usr/share/nginx/html; | |
| index index.html index.htm; | |
| try_files $uri $uri/ /index.html =404; | |
| } | |
| } |
| import { Injectable } from '@angular/core'; | |
| import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; | |
| import { Router } from '@angular/router'; | |
| import { Observable, throwError } from 'rxjs'; | |
| import { catchError, switchMap } from 'rxjs/operators'; | |
| import { AuthService } from '@auth/services/auth.service'; | |
| import { TokenService } from '@auth/services/token.service'; |