Open Closed

Adding new custom route to Angular ABP application #6273


User avatar
0
Pavlo created

I have an account module with personal info, 2 steps verification, and others standard tabs on account/manage route. I have added my custom tab, in which I have a reset-password link that should move me to account/reset-password. But i see only eception message

  • ABP Framework version: v7.2.2
  • UI Type: Angular
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace: Account layout not found. Please check your configuration. If you are using LeptonX, please make sure you have added "AccountLayoutModule.forRoot()" to your app.module configuration
  • Steps to reproduce the issue:
  1. I have added custom Acount module and ovverided it in app-routing module
  2. Added account routing module with need route:
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { CustomChangePasswordComponent } from './custom-change-password/custom-change-password.component';

const routes: Routes = [
  {
    path: 'change-password',
    component: CustomChangePasswordComponent,
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class AccoutRoutingModule {}
  1. Imported it in account-module:
import { NgModule } from '@angular/core';
import { AccountPublicModule } from '@volo/abp.ng.account/public';

import { SharedModule } from '../shared/shared.module';
import { CustomChangePasswordComponent } from './custom-change-password/custom-change-password.component';
import { CustomManageProfileComponent } from './custom-manage-profile/custom-manage-profile.component';
import { OrganizationTabComponent } from './tabs/organization-tab/organization-tab.component';
import { AccoutRoutingModule } from './account-routing.module';

@NgModule({
  declarations: [
    CustomManageProfileComponent,
    OrganizationTabComponent,
    CustomChangePasswordComponent,
  ],
  imports: [AccountPublicModule.forChild({}), SharedModule, AccoutRoutingModule],
})
export class AccountModule {}

After accessing it goes this error: Account layout not found. Please check your configuration. If you are using LeptonX, please make sure you have added "AccountLayoutModule.forRoot()" to your app.module configuration

Thanks


2 Answer(s)
  • User Avatar
    1
    Anjali_Musmade created
    Support Team Support Team Member

    Hello Pavlo,

    Please check below links and have look to the pinned answers

    1. https://support.abp.io/QA/Questions/4364/Account-layout-not-found#answer-4735360b-afeb-0e49-b012-3a08d24539f5
    2. https://support.abp.io/QA/Questions/5417/The-angular-accountlogin-page-is-not-working#answer-3a0c769f-dbaa-2e7a-ee44-6892bfbb6db5

    regards, Anjali

  • User Avatar
    0
    Pavlo created

    Thanks a lot, adding AcountLayoutModule helped

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09