import { NgModule } from '@angular/core'; import { LoginPage } from './login/login.page'; import { RouterModule } from '@angular/router'; import { AdminGuard } from 'x-saherelm-api-sdk'; import { LogoutPage } from './logout/logout.page'; import { ProfilePage } from './profile/profile.page'; import { XCanDeactivateGuard } from 'x-framework-core'; import { ViewsModule } from 'src/app/views/public-api'; import { RegisterPage } from './register/register.page'; import { BaseRoutes } from 'src/app/config/page.config'; import { AuthGuard, NotAuthGuard } from 'x-framework-identity-sdk'; import { AccountRoutes } from 'src/app/views/account/account.configs'; import { EmailConfirmPage } from './email-confirm/email-confirm.page'; import { PhoneConfirmPage } from './phone-confirm/phone-confirm.page'; import { ResetPasswordPage } from './reset-password/reset-password.page'; import { ChangePasswordPage } from './change-password/change-password.page'; import { SearchProfilesPage } from './search-profiles/search-profiles.page'; @NgModule({ declarations: [ LoginPage, LogoutPage, ProfilePage, RegisterPage, PhoneConfirmPage, EmailConfirmPage, ResetPasswordPage, ChangePasswordPage, SearchProfilesPage, ], imports: [ ViewsModule, RouterModule.forChild([ { path: BaseRoutes.Default, redirectTo: AccountRoutes.Profile, pathMatch: 'full', }, // // Login ... { path: AccountRoutes.Login, component: LoginPage, canActivate: [NotAuthGuard], canDeactivate: [XCanDeactivateGuard], }, // // Logout ... { path: AccountRoutes.Logout, component: LogoutPage, canActivate: [AuthGuard], canDeactivate: [XCanDeactivateGuard], }, // // Profile ... { path: AccountRoutes.Profile, component: ProfilePage, canActivate: [AuthGuard], canDeactivate: [XCanDeactivateGuard], }, // // Register ... { path: AccountRoutes.Register, component: RegisterPage, canActivate: [NotAuthGuard], canDeactivate: [XCanDeactivateGuard], }, // // Email Confirm ... { path: AccountRoutes.EmailConfirm, component: EmailConfirmPage, canActivate: [NotAuthGuard], canDeactivate: [XCanDeactivateGuard], }, // // Phone Confirm ... { path: AccountRoutes.PhoneConfirm, component: PhoneConfirmPage, canActivate: [NotAuthGuard], canDeactivate: [XCanDeactivateGuard], }, // // Reset Password ... { path: AccountRoutes.ResetPassword, component: ResetPasswordPage, canActivate: [NotAuthGuard], canDeactivate: [XCanDeactivateGuard], }, // // Change Password ... { path: AccountRoutes.ChangePassword, component: ChangePasswordPage, canActivate: [AuthGuard], canDeactivate: [XCanDeactivateGuard], }, // // Search Profiles ... { path: AccountRoutes.SearchProfiles, component: SearchProfilesPage, canActivate: [AuthGuard], canDeactivate: [XCanDeactivateGuard], }, { path: BaseRoutes.Unknown, pathMatch: 'full', redirectTo: AccountRoutes.Default, }, ]), ], exports: [ // ViewsModule, RouterModule, // LoginPage, LogoutPage, ProfilePage, RegisterPage, PhoneConfirmPage, EmailConfirmPage, ResetPasswordPage, ChangePasswordPage, SearchProfilesPage, ], }) export class AccountPageModule {}