Open Closed

ABP.IO ReplaceableComponent InlineTemplateContentComponent and TemplateContentsComponent #6624


User avatar
0
fernando.guilherme created
  • ABP Framework version: v8.0.1
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hey,

I am unable to replace the InlineTemplateContentComponent and TemplateContentsComponent components.

Could you help me?


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    This is a bug, we will fix it in the next patch version.

    You can try update your app-routing.module

    import {
      authGuard,
      permissionGuard,
      ReplaceableComponents,
      ReplaceableRouteContainerComponent,
      RouterOutletComponent,
    } from '@abp/ng.core';
    import { NgModule } from '@angular/core';
    import { RouterModule, Routes } from '@angular/router';
    import { textTemplateManagementExtensionsResolver, InlineTemplateContentComponent, TemplateContentsComponent , TextTemplatesComponent, eTextTemplateManagementComponents, textTemplateManagementGuard} from '@volo/abp.ng.text-template-management';
    
    
    const routes: Routes = [
      .....
      {
        path: 'text-template-management',
        children: [
          { path: '', redirectTo: 'text-templates', pathMatch: 'full' },
          {
            path: 'text-templates',
            component: RouterOutletComponent,
            canActivate: [authGuard, permissionGuard, textTemplateManagementGuard],
            resolve: [textTemplateManagementExtensionsResolver],
            children: [
              {
                path: '',
                component: ReplaceableRouteContainerComponent,
                data: {
                  requiredPolicy: 'TextTemplateManagement.TextTemplates',
                  replaceableComponent: {
                    key: eTextTemplateManagementComponents.TextTemplates,
                    defaultComponent: TextTemplatesComponent,
                  } as ReplaceableComponents.RouteData<TextTemplatesComponent>,
                },
              },
              {
                path: 'contents',
                component: RouterOutletComponent,
                canActivate: [permissionGuard],
                data: { requiredPolicy: 'TextTemplateManagement.TextTemplates.EditContents' },
                children: [
                  {
                    path: 'inline/:name',
                    component: ReplaceableRouteContainerComponent,
                    data: {
                      replaceableComponent: {
                        key: eTextTemplateManagementComponents.InlineTemplateContent,
                        defaultComponent: InlineTemplateContentComponent,
                      } as ReplaceableComponents.RouteData<InlineTemplateContentComponent>,
                    },
                  },
                  {
                    path: ':name',
                    component: ReplaceableRouteContainerComponent,
                    data: {
                      replaceableComponent: {
                        key: eTextTemplateManagementComponents.TemplateContents,
                        defaultComponent: TemplateContentsComponent,
                      } as ReplaceableComponents.RouteData<TemplateContentsComponent>,
                    },
                  },
                ],
              },
            ]
          },
        ]
      },
      .....
    ]
    
Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09