arch(sprint1): resolve dynamic pages by route config

This commit is contained in:
sdarbinyan
2026-07-03 02:04:01 +04:00
parent ac48799d9a
commit d6a1d5e3f5
4 changed files with 59 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';
import { Router } from '@angular/router';
import { DynamicPageLayoutComponent } from '../../layouts/containers/dynamic-page-layout.component';
import { PageRenderModel } from '../../dynamic-renderer/page-renderer/page-renderer.model';
import { WebsiteRuntimeFacade } from '../../facades/website/website-runtime.facade';
@@ -26,10 +27,11 @@ import { WebsiteRuntimeFacade } from '../../facades/website/website-runtime.faca
export class PlatformHomeComponent {
readonly model = signal<PageRenderModel | null>(null);
readonly loading = signal(true);
private readonly router = inject(Router);
constructor(private readonly websiteRuntime: WebsiteRuntimeFacade) {
this.websiteRuntime.initializeRuntime();
this.websiteRuntime.getPageRenderModel('home').subscribe({
this.websiteRuntime.getPageRenderModelForUrl(this.router.url).subscribe({
next: (model) => {
this.model.set(model);
this.loading.set(false);