App Component

class AppComponent

This component is the root component which is bootstrapped by Angular. It:

  1. Determines whether to load the desktop layout or the mobile layout

  2. Defines the links in side navigation and bottom navigation

  3. Determines whether or not to switch to RTL layout

  4. Determines the active page to highlight in the side navigation and bottom navigation

  5. Determines whether or not to switch font

  6. Determines whether or not to switch theme

  7. Sets the language

  8. Listens to Progress Bar Service to hide or show the progress bar

  9. Initialises Update Service which in turn subscribes to updates

  10. Sends a "Start" event with app version to Analytics Service for tracking app start

app.component.ts
@Component({
  imports: [
    // Buy to unlock
  ],
  selector: 'jet-app',
  standalone: true,
  styleUrl: './app.component.scss',
  templateUrl: './app.component.html',
})
export class AppComponent implements OnInit, OnDestroy {
  private readonly _breakpointObserver = inject(BreakpointObserver);
  private readonly _renderer2 = inject(Renderer2);
  private readonly _meta = inject(Meta);
  private readonly _router = inject(Router);
  private readonly _analyticsService = inject(AnalyticsService);
  private readonly _authenticationService = inject(AuthenticationService);
  private readonly _loggerService = inject(LoggerService);
  private readonly _progressBarService = inject(ProgressBarService);
  private readonly _settingsService = inject(SettingsService);
  private readonly _toolbarTitleService = inject(ToolbarTitleService);
  private readonly _updateService = inject(UpdateService);
  private readonly _translocoService = inject(TranslocoService);

  private readonly _isPwaMode: boolean;
  private _routerSubscription: Subscription;
  private _swUpdateSubscription: Subscription;

  public activeNavigationMenuItemUrl: NavigationMenuItem['url'] | undefined;
  public readonly isSmallViewport: boolean;
  public readonly navigationMenuItems: NavigationMenuItem[];
  public readonly progressBarConfiguration: Signal<ProgressBarConfiguration>;
  public readonly settings: Settings;
  public readonly toolbarTitle: Signal<string>;
  public readonly user: Signal<User | null>;

  public constructor() {
    // Buy to unlock
  }

  public ngOnInit(): void {
    // Buy to unlock
  }

  public ngOnDestroy(): void {
    // Buy to unlock
  }

  private _addFontClass(availableFont: AvailableFont): void {
    // Buy to unlock
  }

  private _addThemeClass(availableTheme: AvailableTheme): void {
    // Buy to unlock
  }

  private _setLanguage(availableLanguage: AvailableLanguage): void {
    // Buy to unlock
  }

  private _setZoom(isPwaMode: boolean): void {
    // Buy to unlock
  }
}

Last updated