link Management App
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<div class="container">
|
||||
<app-title title="Tool List"></app-title>
|
||||
<tool *ngFor="let tool of tools" [name]="tool.name" [url]="tool.url" [userName]="tool.userName" [password]="tool.password"></tool>
|
||||
</div>
|
||||
@@ -0,0 +1,7 @@
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ToolListComponent } from './tool-list.component';
|
||||
|
||||
describe('ToolListComponent', () => {
|
||||
let component: ToolListComponent;
|
||||
let fixture: ComponentFixture<ToolListComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [ToolListComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(ToolListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
24
src/app/components/pages/tool-list/tool-list.component.ts
Normal file
24
src/app/components/pages/tool-list/tool-list.component.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ToolComponent } from "../../partials/tool/tool.component";
|
||||
import { ToolListService } from '../../../shared/module/tool-list.module';
|
||||
import { Tool } from '../../../shared/model/tool.model';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TitleComponent } from "../../partials/title/title.component";
|
||||
|
||||
@Component({
|
||||
selector: 'app-tool-list',
|
||||
standalone: true,
|
||||
imports: [ToolComponent, CommonModule, TitleComponent],
|
||||
templateUrl: './tool-list.component.html',
|
||||
styleUrl: './tool-list.component.scss'
|
||||
})
|
||||
export class ToolListComponent implements OnInit {
|
||||
tools!: Tool[];
|
||||
|
||||
constructor(private toolListService: ToolListService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.tools = this.toolListService.getAllTools()
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user