How to validate form while button click

How to validate a form while button click. Actually i want to do if any field is empty when i click on a submit button there i want a alert message like this field is required. how can i do that
Please help me out

here is an example
html file

<form [formGroup]='userForm' (ngSubmit)='goHomePage()'>
        <div class="input_div">
            <ion-item class="ip" [class.invalid]=" formFlag? !userForm.controls.username.valid : null ">
                <ion-input placeholder="Email Or Username" type='email' formControlName='username'></ion-input>
                <img src="assets/imgs/small_user.png" item-right>
            <ion-item class="ip" [class.invalid]=" formFlag? !userForm.controls.password.valid : null ">
                <ion-input placeholder="Password" formControlName='password' type='password'></ion-input>
                <img src="assets/imgs/key.png" item-right>
        <div class="button_div">
            <button ion-button round class="btn">LOGIN</button>

ts file

    this.formFlag = true;
    if(this.userForm.valid) {
        logic if form is valid

css file

        border: 1px solid color($colors, err) !important;