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>
|
||||
<h1>Hello, world!</h1>
|
||||
<p>Current View: {{ currentView$ | async }}</p>
|
||||
@switch (currentView$ | async) {
|
||||
@default {
|
||||
<app-starting-point></app-starting-point>
|
||||
}
|
||||
}
|
||||
</main>
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -5,7 +5,7 @@ export interface AppState {
|
|||
}
|
||||
|
||||
export enum CurrentView {
|
||||
StartingPoint = 0,
|
||||
StartingPoint = 'startingPoint',
|
||||
}
|
||||
|
||||
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