Angular Form onSubmit() is called by other button

I am doing an Angular 12 Material App. I have a simple Form like this <form [formGroup]="form" class="normal-form" (ngSubmit)="onSubmit()"> <mat-grid-list cols="2" rowHeight="300px"> <mat-grid-tile> <div class="controles-container"> <input type="hidden" formControlName="Id"> <mat-label><strong>Active</strong></mat-label> <mat-slide-toggle formControlName="IsActive" [checked]="checked"> </mat-slide-toggle> <textarea matInput hidden></textarea> <mat-form-field> <input formControlName="Name" matInput placeholder=" Notification Name" > <mat-error>This field is mandatory</mat-error> </mat-form-field> <mat-form-field> <mat-select formControlName="ProcessorName" placeholder="Processor Name"> <ng-container… Read More Angular Form onSubmit() is called by other button

angular error handling not working using angular 12

I tried angular error manager, I created a posts.component.ts component, I created a posts.service.ts service, I retrieved the posts by api: https://jsonplaceholder.typicode.com/posts, 100 posts, now generate an error, by deleting a non-existent post post n123. when I click on button delete, it does not manage any error either alert or console. post.component.html <ul class="list-group"> <li… Read More angular error handling not working using angular 12

Use parent component's variable, in its method that is invoked by a child component

I’m using a child component: <app-photo-editor [addPhotoUrlExtension]="’users/add-photo’" [onUploadSuccess]="onUploadPhotoSuccess" [deletePhoto]="onDeletePhoto"></app-photo-editor> and passing it the onUploadPhotoSuccess function: onUploadPhotoSuccess(response: any) { if (response) { const photo = JSON.parse(response); this.member.photoUrl = photo.url; // offending line … On the child component, I accept the function, and invoke the parent’s function: export class PhotoEditorComponent implements OnInit { @Input() onUploadSuccess: (response: any)… Read More Use parent component's variable, in its method that is invoked by a child component

No overload matches this call. angular2 to angular12

I am upgrading my Angular-2 project to Angular-12 project and when I changed : Before import { Http, Response, Headers } from ‘@angular/http’; After import { HttpClient, HttpResponse, HttpHeaders } from ‘@angular/common/http’; I am facing issue to use HttpHeaders in place of Headers You can see the images below. I am stuck here. Need some… Read More No overload matches this call. angular2 to angular12