Skip to content

Commit

Permalink
refactor(FeaturesComponent): Convert to standalone (#1787)
Browse files Browse the repository at this point in the history
  • Loading branch information
hirokiterashima authored May 9, 2024
1 parent d9b1a86 commit dc94348
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 63 deletions.
2 changes: 1 addition & 1 deletion src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const routes: Routes = [
},
{
path: 'features',
loadChildren: () => import('./features/features.module').then((m) => m.FeaturesModule)
loadComponent: () => import('./features/features.component').then((m) => m.FeaturesComponent)
},
{
path: 'forgot',
Expand Down
11 changes: 0 additions & 11 deletions src/app/features/features-routing.module.ts

This file was deleted.

17 changes: 9 additions & 8 deletions src/app/features/features.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';

import { FeaturesComponent } from './features.component';
import { provideRouter } from '@angular/router';

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

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
declarations: [FeaturesComponent],
schemas: [NO_ERRORS_SCHEMA]
}).compileComponents();
}));
beforeEach(
waitForAsync(() => {
TestBed.configureTestingModule({
imports: [FeaturesComponent],
providers: [provideRouter([])]
}).compileComponents();
})
);

beforeEach(() => {
fixture = TestBed.createComponent(FeaturesComponent);
Expand Down
27 changes: 19 additions & 8 deletions src/app/features/features.component.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import { Component, OnInit } from '@angular/core';
import { CommonModule } from '@angular/common';
import { Component } from '@angular/core';
import { FlexLayoutModule } from '@angular/flex-layout';
import { MatButtonModule } from '@angular/material/button';
import { MatDividerModule } from '@angular/material/divider';
import { MatIconModule } from '@angular/material/icon';
import { RouterModule } from '@angular/router';

@Component({
imports: [
CommonModule,
FlexLayoutModule,
MatButtonModule,
MatDividerModule,
MatIconModule,
RouterModule
],
selector: 'app-features',
templateUrl: './features.component.html',
styleUrls: ['./features.component.scss']
standalone: true,
styleUrl: './features.component.scss',
templateUrl: './features.component.html'
})
export class FeaturesComponent implements OnInit {
constructor() {}

ngOnInit() {}
}
export class FeaturesComponent {}
13 changes: 0 additions & 13 deletions src/app/features/features.module.spec.ts

This file was deleted.

22 changes: 0 additions & 22 deletions src/app/features/features.module.ts

This file was deleted.

0 comments on commit dc94348

Please sign in to comment.