Add a Works page
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
a86a40e845
commit
3bd2c44bad
@ -0,0 +1,5 @@
|
||||
<div>
|
||||
<h4>{{ work.id_work }} - {{ work.title }}</h4>
|
||||
<span> WORK CONTENT : {{ work.content }}</span>
|
||||
<a [routerLink]="['/work/', work.id_work]">Edit Code</a>
|
||||
</div>
|
@ -0,0 +1,22 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { WorkListDetailComponent } from './work-list-detail.component';
|
||||
|
||||
describe('WorkListDetailComponent', () => {
|
||||
let component: WorkListDetailComponent;
|
||||
let fixture: ComponentFixture<WorkListDetailComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [WorkListDetailComponent],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(WorkListDetailComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
@ -0,0 +1,14 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { Work } from '../../models/work.model';
|
||||
import { RouterLink } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-work-list-detail',
|
||||
standalone: true,
|
||||
imports: [RouterLink],
|
||||
templateUrl: './work-list-detail.component.html',
|
||||
styleUrl: './work-list-detail.component.css',
|
||||
})
|
||||
export class WorkListDetailComponent {
|
||||
@Input() work!: Work;
|
||||
}
|
@ -1,37 +1,6 @@
|
||||
<div>
|
||||
<div *ngIf="work">
|
||||
<h2>Works</h2>
|
||||
|
||||
<ul>
|
||||
<li *ngFor="let work of works">
|
||||
{{ work.id_work }} - {{ work.link }} - {{ work.content }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<form #addBookForm="ngForm" (ngSubmit)="onSubmit(addBookForm)">
|
||||
<div class="form-group">
|
||||
<label for="link">Link</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="link"
|
||||
name="link"
|
||||
ngModel
|
||||
required />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="content">Content</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-control"
|
||||
id="content"
|
||||
name="content"
|
||||
ngModel
|
||||
required />
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</form>
|
||||
<h3>CURRENT WORK ID - {{ work.id_work }}</h3>
|
||||
|
||||
<!-- <app-editor></app-editor>-->
|
||||
</div>
|
||||
|
Loading…
Reference in new issue