• Skip to main content
  • Skip to primary sidebar

Web Development Archive

  • Archive
You are here: Home / Other / Display sidebar only on subpage

Display sidebar only on subpage

// src/app/shared/store/store.service.ts
import { computed, Injectable, signal } from '@angular/core';

@Injectable({ providedIn: 'root' })
export class StoreService {
public readonly isSubPage = signal<boolean>(false);


public setIsSubPage(value: boolean): void {
this.isSubPage.set(value);
}
}
 <div class="container">
@if (store.isSubPage()) {
<div class="grid md:grid-cols-[1fr_360px] gap-6">
<main class="bg-surface-card-light dark:bg-primary-900 rounded-2xl p-6 shadow-2xl w-full">
<router-outlet />
</main>
@if (store.isLoading()) {
<p-skeleton height="222px" class="mb-2" />
} @else {
<app-sidebar />
}
</div>
} @else {
<app-news></app-news>
}
</div>

Filed Under: Other

About Gabor Flamich

I'm a web developer and designer based in Budapest, Hungary. In recent years, I've documented hundreds of solutions I came across during development. This site is an archive for useful code snippets on WordPress, Genesis Framework and WooCommerce. If You have any questions related to WordPress development, get in touch!

Primary Sidebar

  • angular.io
© 2026 WP Flames - All Right Reserved