refactor: reorganize component structure and files
This commit is contained in:
@ -1,13 +1,12 @@
|
|||||||
import {Component} from '@angular/core';
|
import {Component} from '@angular/core';
|
||||||
import {RouterOutlet} from '@angular/router';
|
import {RouterOutlet} from '@angular/router';
|
||||||
import {TableComponent} from "./table/table.component";
|
import {TableComponent} from "./components/table/table.component";
|
||||||
import {FormComponent} from "./form/form.component";
|
import {FormComponent} from "./components/form/form.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-root',
|
selector: 'app-root',
|
||||||
imports: [RouterOutlet, TableComponent, FormComponent],
|
imports: [RouterOutlet, TableComponent, FormComponent],
|
||||||
templateUrl: './app.component.html',
|
templateUrl: './app.component.html',
|
||||||
styleUrl: './app.component.css',
|
|
||||||
standalone: true,
|
standalone: true,
|
||||||
})
|
})
|
||||||
export class AppComponent {
|
export class AppComponent {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import {Component, effect, inject, model} from '@angular/core';
|
import {Component, effect, inject, model} from '@angular/core';
|
||||||
import {Todo} from "../dto/models";
|
import {Todo} from "../../shii/dto/models";
|
||||||
import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
|
import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
|
||||||
import {DatePipe} from "@angular/common";
|
import {DatePipe} from "@angular/common";
|
||||||
import {TodoService} from "../service/todo.service";
|
import {TodoService} from "../../shii/service/todo.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-form',
|
selector: 'app-form',
|
||||||
@ -11,7 +11,6 @@ import {TodoService} from "../service/todo.service";
|
|||||||
],
|
],
|
||||||
templateUrl: './form.component.html',
|
templateUrl: './form.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
styleUrl: './form.component.css'
|
|
||||||
})
|
})
|
||||||
export class FormComponent {
|
export class FormComponent {
|
||||||
todo = model<Todo|null>(null);
|
todo = model<Todo|null>(null);
|
@ -1,7 +1,7 @@
|
|||||||
import {Component, effect, EventEmitter, inject, signal, Signal, WritableSignal} from '@angular/core';
|
import {Component, effect, EventEmitter, inject, signal, Signal, WritableSignal} from '@angular/core';
|
||||||
import {TodoService} from "../service/todo.service";
|
import {TodoService} from "../../shii/service/todo.service";
|
||||||
import {DatePipe} from "@angular/common";
|
import {DatePipe} from "@angular/common";
|
||||||
import {Todo} from "../dto/models";
|
import {Todo} from "../../shii/dto/models";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-table',
|
selector: 'app-table',
|
||||||
@ -10,7 +10,6 @@ import {Todo} from "../dto/models";
|
|||||||
DatePipe,
|
DatePipe,
|
||||||
],
|
],
|
||||||
templateUrl: './table.component.html',
|
templateUrl: './table.component.html',
|
||||||
styleUrl: './table.component.css'
|
|
||||||
})
|
})
|
||||||
export class TableComponent {
|
export class TableComponent {
|
||||||
todoService: TodoService = inject(TodoService);
|
todoService: TodoService = inject(TodoService);
|
Reference in New Issue
Block a user