Newer
Older
import { Component, OnInit, ViewChild } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { NotificationService } from '../../../service/notification.service';
import { AuthService } from '../../../service/auth.service';
import { TranslateService } from '@ngx-translate/core';
import { ModalController } from '@ionic/angular';
import { OtpYousignComponent } from './yousign/otp-yousign.component';
import { catchError, tap } from 'rxjs/operators';
import { of } from 'rxjs';
@Component({
selector: 'app-otp-create',
templateUrl: 'otp-create.component.html',
styleUrls: ['otp-create.component.scss'],
})
export class OtpCreateComponent implements OnInit {
@ViewChild('appOtpYousign', { static: false }) appOtpYousign: OtpYousignComponent;
sources: any[] = [];
currentSource: any = null;
constructor(
public http: HttpClient,
private translate: TranslateService,
public notificationService: NotificationService,
public authService: AuthService,
public modalController: ModalController
) { }
ngOnInit(): void {
this.getConfig();
}
getConfig() {
this.http.get(`../rest/connectors`).pipe(
this.sources = data.otp;
this.currentSource = this.sources[0];
}),
catchError(err => {
this.notificationService.handleErrors(err);
return of(false);
})
).subscribe();