Skip to content

Commit

Permalink
feat(home): add HomeComponent with routing and basic template
Browse files Browse the repository at this point in the history
  • Loading branch information
marcolongol committed Feb 5, 2025
1 parent 7920122 commit 6af079e
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 4 deletions.
4 changes: 1 addition & 3 deletions apps/frontend/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ import { RouterModule } from '@angular/router';
templateUrl: './app.component.html',
styleUrl: './app.component.scss',
})
export class AppComponent {
title = 'frontend';
}
export class AppComponent {}
8 changes: 7 additions & 1 deletion apps/frontend/src/app/app.routes.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import { Route } from '@angular/router';

export const appRoutes: Route[] = [];
export const appRoutes: Route[] = [
{
path: '',
loadComponent: () =>
import('./home/home.component').then((m) => m.HomeComponent),
},
];
1 change: 1 addition & 0 deletions apps/frontend/src/app/home/home.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>home works!</p>
Empty file.
21 changes: 21 additions & 0 deletions apps/frontend/src/app/home/home.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { HomeComponent } from './home.component';

describe('HomeComponent', () => {
let component: HomeComponent;
let fixture: ComponentFixture<HomeComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HomeComponent],
}).compileComponents();

fixture = TestBed.createComponent(HomeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
13 changes: 13 additions & 0 deletions apps/frontend/src/app/home/home.component.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { HomeComponent } from './home.component';

const meta: Meta<HomeComponent> = {
component: HomeComponent,
title: 'HomeComponent',
};
export default meta;
type Story = StoryObj<HomeComponent>;

export const Primary: Story = {
args: {},
};
10 changes: 10 additions & 0 deletions apps/frontend/src/app/home/home.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';

@Component({
selector: 'app-home',
imports: [CommonModule],
templateUrl: './home.component.html',
styleUrl: './home.component.scss',
})
export class HomeComponent {}

0 comments on commit 6af079e

Please sign in to comment.