Add starting point component to view

This commit is contained in:
Z. Charles Dziura 2025-06-30 21:27:18 -04:00
parent 850b99d871
commit 8b3def5728
6 changed files with 21 additions and 5 deletions

View file

@ -1,4 +1,7 @@
<main>
<h1>Hello, world!</h1>
<p>Current View: {{ currentView$ | async }}</p>
@switch (currentView$ | async) {
@default {
<app-starting-point></app-starting-point>
}
}
</main>

View file

@ -1,13 +1,15 @@
import { AsyncPipe } from '@angular/common';
import { Component, inject, OnInit } from '@angular/core';
import { ChangeDetectionStrategy, Component, inject, OnInit } from '@angular/core';
import { select, Store } from '@ngrx/store';
import { selectCurrentView } from './state/state.selectors';
import { StartingPoint } from './views/starting-point/starting-point';
@Component({
selector: 'app-root',
templateUrl: './app.html',
styleUrl: './app.scss',
imports: [AsyncPipe],
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [AsyncPipe, StartingPoint],
})
export class App implements OnInit {
private readonly store$ = inject(Store);

View file

@ -5,7 +5,7 @@ export interface AppState {
}
export enum CurrentView {
StartingPoint = 0,
StartingPoint = 'startingPoint',
}
export const initialState: AppState = {

View file

@ -0,0 +1 @@
<p>starting-point works!</p>

View file

@ -0,0 +1,10 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
selector: 'app-starting-point',
imports: [],
templateUrl: './starting-point.html',
styleUrl: './starting-point.scss',
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class StartingPoint {}