Add starting point component to view
This commit is contained in:
parent
850b99d871
commit
8b3def5728
6 changed files with 21 additions and 5 deletions
|
@ -1,4 +1,7 @@
|
||||||
<main>
|
<main>
|
||||||
<h1>Hello, world!</h1>
|
@switch (currentView$ | async) {
|
||||||
<p>Current View: {{ currentView$ | async }}</p>
|
@default {
|
||||||
|
<app-starting-point></app-starting-point>
|
||||||
|
}
|
||||||
|
}
|
||||||
</main>
|
</main>
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
import { AsyncPipe } from '@angular/common';
|
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 { select, Store } from '@ngrx/store';
|
||||||
import { selectCurrentView } from './state/state.selectors';
|
import { selectCurrentView } from './state/state.selectors';
|
||||||
|
import { StartingPoint } from './views/starting-point/starting-point';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
templateUrl: './app.html',
|
templateUrl: './app.html',
|
||||||
styleUrl: './app.scss',
|
styleUrl: './app.scss',
|
||||||
imports: [AsyncPipe],
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
|
imports: [AsyncPipe, StartingPoint],
|
||||||
})
|
})
|
||||||
export class App implements OnInit {
|
export class App implements OnInit {
|
||||||
private readonly store$ = inject(Store);
|
private readonly store$ = inject(Store);
|
||||||
|
|
|
@ -5,7 +5,7 @@ export interface AppState {
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum CurrentView {
|
export enum CurrentView {
|
||||||
StartingPoint = 0,
|
StartingPoint = 'startingPoint',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const initialState: AppState = {
|
export const initialState: AppState = {
|
||||||
|
|
1
src/app/views/starting-point/starting-point.html
Normal file
1
src/app/views/starting-point/starting-point.html
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<p>starting-point works!</p>
|
0
src/app/views/starting-point/starting-point.scss
Normal file
0
src/app/views/starting-point/starting-point.scss
Normal file
10
src/app/views/starting-point/starting-point.ts
Normal file
10
src/app/views/starting-point/starting-point.ts
Normal 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 {}
|
Loading…
Add table
Reference in a new issue