global.ResizeObserver = jest.fn().mockImplementation(callback => {
let elements: any[] = [];
const observe = jest.fn(element => {
elements.push(element);
// Here you can simulate setting height and width
callback([{ target: element, contentRect: { width: 100, height: 200 } }]);
});
form: FormGroup = new FormGroup({
email: new FormControl('', [Validators.required], [this.customValidator()])
})
customValidator(): AsyncValidatorFn {
return (control: AbstractControl): Observable<ValidationErrors | null> => {
return this.loginService.checkUserExist({value: control?.value, type: 1})
.pipe(map((res: {status: boolean, message: string}) => {
return res?.status ? null : { duplicate: true };
const signalTraps = ['SIGTERM', 'SIGINT', 'SIGUSR2'];
signalTraps.forEach(type => {
process.once(type, async () => {
try {
console.log("On Exist");
// perform operations here
// await consumer.disconnect()
} finally {
import { Directive, ElementRef, OnInit, AfterViewInit } from '@angular/core';
@Directive({
selector: '[appAutofocus]'
})
export class AutofocusDirective implements OnInit, AfterViewInit {
constructor(private elementRef: ElementRef) { }
sudo apt update
sudo apt install nginx
Check this out on Dev.to
- How to handle SSH keys with ec2-github actions https://zellwk.com/blog/github-actions-deploy/
- SSH_PRIVATE_KEY
- HOST_NAME / IP_ADDRESS