arch(sprint1): resolve dynamic pages by route config
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user