When a user submits a form on my website, they are redirected to another page where a success message is displayed.
Below is the code from the article-update.component.html file:
<form class="form-horizontal" [formGroup] = 'articleUpdateForm' (ngSubmit) = 'onSubmit()' enctype="multipart/form-data">
<label for="articleTitle">Title</label>
<input class="form-control" type="text" id="articleTitle" formControlName="title" [ngClass]="{ 'is-invalid': submitDisable && formValues.title.errors }" />
<label>Description</label>
<textarea formControlName='description' id="summernote" class="summernote"></textarea>
<button class="btn btn-info" type="submit">Update</button>
</form>
The content of the article-update.component.ts file is as follows:
import { Component, OnInit } from '@angular/core';
import {FormBuilder, FormControl, FormGroup, ValidatorFn, Validators} from '@angular/forms';
@Component({
selector: 'kt-article-update',
templateUrl: './article-update.component.html',
styleUrls: ['./article-update.component.scss']
})
export class ArticleUpdateComponent implements OnInit {
// Code for the component...
}