Modal problem in ionic

there is a click event in a button on the login page about.html
< button ion-button outline (click) = "tomodal ()" > there is no login < / button >
in
about.ts

import {Register} from". / register"
tomodal () {

console.log(1);
let contactModal = this.modalCtrl.create(Register);
contactModal.present();

}
directory:

clipboard.png
register.html:


register.ts:
import { Component } from "@angular/core";
import { ModalController, Platform, NavParams, ViewController } from "ionic-angular";

@Component({


})
export class Register {


}

:
clipboard.png
:

clipboard.png

page appears but the login page does not disappear. Why

May.22,2021
The essence of

Modal is the same as the Modal of our common web pages, that is, a container, such as div, pops up on the current page for users to operate, but the z-index setting is a little larger, and there is no need to replace the current interface. This Modal is actually a sub-component of the current interface. Control its display or not through display. You can set the background color and size of the Modal interface to see the final effect.

Menu