Image for post
Image for post
Photo by Blake Connally on Unsplash

Forms are major parts of every Angular project and in this article, we want to implement a Reactive Angular form with a custom and dynamic validator.

Prepare an Angular project with Angular Material and Bootstrap using Angular CLI

First, we need to initialize an Angular project, and then add bootstrap and Angular Material to the project. All can be done using Angular-CLI like this:

// for creating an angular project:
ng new angular-forms
// for adding bootstrap
npm install --save bootstrap
// for adding Angular Material
ng add @angular/material

Note that you need to make sure that you have both bootstrap and angular materials in yourfile like this:

"styles": [
"./node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css",
"./node_modules/bootstrap/dist/css/bootstrap.css",
"src/styles.css" …


In JavaScript, we have these three methods as a part of Array.prototype method, but what are the differences between them and what do they exactly do? so let’s dive into them!

Image for post
Image for post
Photo by Mazhar Zandsalimi on Unsplash

1. So let’s begin with the filter() method:

The filter method applies on an array and then creates a new array and on the new array, it filters the first array based on the function we have provided to. …

About

Hossein Mousavi

JavaScript Developer | Linux Enthusiastic | HMousavi.dev

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store