import { Component } from '@angular/core'; import { Router } from '@angular/router'; @Component({   selector: 'app-register',   templateUrl: 'register.page.html',   styleUrls: ['register.page.scss'] }) export class RegisterPage {   username: string='';   password: string='';   confirmPassword: string='';   registerFailed: boolean = false;   constructor(private router: Router) {}   register() {     // 真实项目中应该调用后端API进行用户注册     // 这里简单模拟注册成功     this.router.navigate(['/login']);   }   goToLogin() {     this.router.navigate(['/login']);   } }