add routing for comics and media
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<div class="app">
|
||||
<kontor-header />
|
||||
<main>
|
||||
<router-outlet />
|
||||
</main>
|
||||
|
||||
<kontor-footer />
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterOutlet } from '@angular/router';
|
||||
import { KontorHeaderComponent } from "./kontor/header/header.component";
|
||||
import { KontorFooterComponent } from './kontor/footer/footer.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet, KontorHeaderComponent, KontorFooterComponent],
|
||||
templateUrl: './app.component.html',
|
||||
styleUrl: './app.component.css'
|
||||
})
|
||||
export class AppComponent {
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
<div class="app">
|
||||
<header>
|
||||
<section>
|
||||
<h1>{{ title() }}</h1>
|
||||
</section>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a routerLink="/">Kontor</a></li>
|
||||
<li><a routerLink="/comic">Comics</a></li>
|
||||
<li><a routerLink="/tysc">TradeYourSportsCards</a></li>
|
||||
<li><a routerLink="/media">Media</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<router-outlet />
|
||||
</main>
|
||||
|
||||
<footer>
|
||||
<a href="{{ footerUrl }}">{{ footerLink }}</a>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -1,21 +1,34 @@
|
||||
import { Routes } from '@angular/router';
|
||||
import { Kontor } from './kontor/kontor';
|
||||
import { KontorComponent } from './kontor/kontor.component';
|
||||
import { Login } from './common/login/login';
|
||||
import { Comics } from './comic/comics/comics';
|
||||
import { Publisher } from './comic/publisher/publisher';
|
||||
import { Artist } from './comic/artist/artist';
|
||||
import { ComicOverview } from './comic/comic-overview/comic-overview';
|
||||
import { ComicsListComponent } from './comic/comics/comics-list.component';
|
||||
import { PublisherListComponent } from './comic/publisher/publisher-list.component';
|
||||
import { ArtistListComponent } from './comic/artist/artist-list.component';
|
||||
import { ComicOverviewComponent } from './comic/comic-overview/comic-overview.component';
|
||||
import { MediaOverviewComponent } from './media/media-overview/media-overview.component';
|
||||
import { MediaFilesListComponent } from './media/media-files-list/media-files-list.component';
|
||||
import { MediaActorsListComponent } from './media/media-actors-list/media-actors-list.component';
|
||||
import { MediaVideosListComponent } from './media/media-videos-list/media-videos-list.component';
|
||||
|
||||
export const routes: Routes = [
|
||||
{ path: '', component: Kontor, },
|
||||
{ path: '', component: KontorComponent, },
|
||||
{ path: 'login', component: Login, },
|
||||
{
|
||||
path: 'comic', component: ComicOverview,
|
||||
path: 'comic', component: ComicOverviewComponent,
|
||||
children: [
|
||||
{ path: 'comics', component: Comics},
|
||||
{ path: 'publisher', component: Publisher},
|
||||
{ path: 'artist', component: Artist},
|
||||
{ path: '', component: ComicsListComponent},
|
||||
{ path: 'comics', component: ComicsListComponent},
|
||||
{ path: 'publisher', component: PublisherListComponent},
|
||||
{ path: 'artist', component: ArtistListComponent},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'media', component: MediaOverviewComponent,
|
||||
children: [
|
||||
{ path: '', component: MediaFilesListComponent},
|
||||
{ path: 'mediafiles', component: MediaFilesListComponent},
|
||||
{ path: 'mediaactors', component: MediaActorsListComponent},
|
||||
{ path: 'mediavideos', component: MediaVideosListComponent},
|
||||
],
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import { Component, signal } from '@angular/core';
|
||||
import { RouterLink, RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
imports: [RouterOutlet, RouterLink],
|
||||
templateUrl: './app.html',
|
||||
styleUrl: './app.css'
|
||||
})
|
||||
export class App {
|
||||
protected readonly title = signal('kontor-angular');
|
||||
footerUrl = "https://kontor.thpeetz.de";
|
||||
footerLink = "kontor.thpeetz.de";
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Artist } from './artist';
|
||||
import { Artist } from './artist-list.component';
|
||||
|
||||
describe('Artist', () => {
|
||||
let component: Artist;
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'kontor-artist-list',
|
||||
imports: [],
|
||||
templateUrl: './artist-list.component.html',
|
||||
styleUrl: './artist-list.component.css'
|
||||
})
|
||||
export class ArtistListComponent {
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-artist',
|
||||
imports: [],
|
||||
templateUrl: './artist.html',
|
||||
styleUrl: './artist.css'
|
||||
})
|
||||
export class Artist {
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ComicOverview } from './comic-overview';
|
||||
import { ComicOverview } from './comic-overview.component';
|
||||
|
||||
describe('ComicOverview', () => {
|
||||
let component: ComicOverview;
|
||||
+3
-3
@@ -4,9 +4,9 @@ import { RouterLink, RouterOutlet } from '@angular/router';
|
||||
@Component({
|
||||
selector: 'app-comic-overview',
|
||||
imports: [RouterLink, RouterOutlet],
|
||||
templateUrl: './comic-overview.html',
|
||||
styleUrl: './comic-overview.css'
|
||||
templateUrl: './comic-overview.component.html',
|
||||
styleUrl: './comic-overview.component.css'
|
||||
})
|
||||
export class ComicOverview {
|
||||
export class ComicOverviewComponent {
|
||||
|
||||
}
|
||||
+5
-5
@@ -1,18 +1,18 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Comics } from './comics';
|
||||
import { ComicsListComponent } from './comics-list.component';
|
||||
|
||||
describe('Comics', () => {
|
||||
let component: Comics;
|
||||
let fixture: ComponentFixture<Comics>;
|
||||
let component: ComicsListComponent;
|
||||
let fixture: ComponentFixture<ComicsListComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [Comics]
|
||||
imports: [ComicsListComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(Comics);
|
||||
fixture = TestBed.createComponent(ComicsListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'kontor-comics-list',
|
||||
imports: [],
|
||||
templateUrl: './comics-list.component.html',
|
||||
styleUrl: './comics-list.component.css'
|
||||
})
|
||||
export class ComicsListComponent {
|
||||
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterLink, RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'app-comics',
|
||||
imports: [RouterLink, RouterOutlet],
|
||||
templateUrl: './comics.html',
|
||||
styleUrl: './comics.css'
|
||||
})
|
||||
export class Comics {
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Publisher } from './publisher';
|
||||
import { Publisher } from './publisher-list.component';
|
||||
|
||||
describe('Publisher', () => {
|
||||
let component: Publisher;
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'kontor-publisher-list',
|
||||
imports: [],
|
||||
templateUrl: './publisher-list.component.html',
|
||||
styleUrl: './publisher-list.component.css'
|
||||
})
|
||||
export class PublisherListComponent {
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-publisher',
|
||||
imports: [],
|
||||
templateUrl: './publisher.html',
|
||||
styleUrl: './publisher.css'
|
||||
})
|
||||
export class Publisher {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
<footer>
|
||||
<a href="{{ footerUrl }}">{{ footerLink }}</a>
|
||||
</footer>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { KontorFooterComponent } from './footer.component';
|
||||
|
||||
describe('KontorFooterComponent', () => {
|
||||
let component: KontorFooterComponent;
|
||||
let fixture: ComponentFixture<KontorFooterComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [KontorFooterComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(KontorFooterComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'kontor-footer',
|
||||
imports: [],
|
||||
templateUrl: './footer.component.html',
|
||||
styleUrl: './footer.component.css'
|
||||
})
|
||||
export class KontorFooterComponent {
|
||||
footerUrl = "https://kontor.thpeetz.de";
|
||||
footerLink = "kontor.thpeetz.de";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<header>
|
||||
<section>
|
||||
<h1>{{ title() }}</h1>
|
||||
</section>
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a routerLink="/">Kontor</a></li>
|
||||
<li><a routerLink="/comic">Comics</a></li>
|
||||
<li><a routerLink="/tysc">TradeYourSportsCards</a></li>
|
||||
<li><a routerLink="/media">Media</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { KontorHeaderComponent } from './header.component';
|
||||
|
||||
describe('Header', () => {
|
||||
let component: KontorHeaderComponent;
|
||||
let fixture: ComponentFixture<KontorHeaderComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [KontorHeaderComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(KontorHeaderComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
import { Component, signal } from '@angular/core';
|
||||
import { RouterLink } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'kontor-header',
|
||||
imports: [RouterLink],
|
||||
templateUrl: './header.component.html',
|
||||
styleUrl: './header.component.css'
|
||||
})
|
||||
export class KontorHeaderComponent {
|
||||
protected readonly title = signal('Kontor');
|
||||
|
||||
}
|
||||
+5
-5
@@ -1,18 +1,18 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { Kontor } from './kontor';
|
||||
import { KontorComponent } from './kontor.component';
|
||||
|
||||
describe('Kontor', () => {
|
||||
let component: Kontor;
|
||||
let fixture: ComponentFixture<Kontor>;
|
||||
let component: KontorComponent;
|
||||
let fixture: ComponentFixture<KontorComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [Kontor]
|
||||
imports: [KontorComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(Kontor);
|
||||
fixture = TestBed.createComponent(KontorComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-kontor',
|
||||
imports: [],
|
||||
templateUrl: './kontor.component.html',
|
||||
styleUrl: './kontor.component.css'
|
||||
})
|
||||
export class KontorComponent {
|
||||
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-kontor',
|
||||
imports: [],
|
||||
templateUrl: './kontor.html',
|
||||
styleUrl: './kontor.css'
|
||||
})
|
||||
export class Kontor {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>media-actors-list works!</p>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MediaActorsListComponent } from './media-actors-list.component';
|
||||
|
||||
describe('MediaActorsList', () => {
|
||||
let component: MediaActorsListComponent;
|
||||
let fixture: ComponentFixture<MediaActorsListComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [MediaActorsListComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(MediaActorsListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-media-actors-list',
|
||||
imports: [],
|
||||
templateUrl: './media-actors-list.component.html',
|
||||
styleUrl: './media-actors-list.component.css'
|
||||
})
|
||||
export class MediaActorsListComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>media-files-list works!</p>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MediaFilesListComponent } from './media-files-list.component';
|
||||
|
||||
describe('MediaFilesList', () => {
|
||||
let component: MediaFilesListComponent;
|
||||
let fixture: ComponentFixture<MediaFilesListComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [MediaFilesListComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(MediaFilesListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-media-files-list',
|
||||
imports: [],
|
||||
templateUrl: './media-files-list.component.html',
|
||||
styleUrl: './media-files-list.component.css'
|
||||
})
|
||||
export class MediaFilesListComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<p>media-overview works!</p>
|
||||
<div>
|
||||
<ul>
|
||||
<li><a routerLink="/media/mediafiles">MediaFiles</a></li>
|
||||
<li><a routerLink="/media/mediaactors">MediaActors</a></li>
|
||||
<li><a routerLink="/media/mediavideos">MediaVideos</a></li>
|
||||
</ul>
|
||||
<h4>Child Routes Result</h4>
|
||||
<router-outlet></router-outlet>
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MediaOverviewComponent } from './media-overview.component';
|
||||
|
||||
describe('MediaOverview', () => {
|
||||
let component: MediaOverviewComponent;
|
||||
let fixture: ComponentFixture<MediaOverviewComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [MediaOverviewComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(MediaOverviewComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { RouterLink, RouterOutlet } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'kontor-media-overview',
|
||||
imports: [RouterOutlet, RouterLink],
|
||||
templateUrl: './media-overview.component.html',
|
||||
styleUrl: './media-overview.component.css'
|
||||
})
|
||||
export class MediaOverviewComponent {
|
||||
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<p>media-videos-list works!</p>
|
||||
@@ -0,0 +1,23 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MediaVideosListComponent } from './media-videos-list.component';
|
||||
|
||||
describe('MediaVideosList', () => {
|
||||
let component: MediaVideosListComponent;
|
||||
let fixture: ComponentFixture<MediaVideosListComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
imports: [MediaVideosListComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(MediaVideosListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,11 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-media-videos-list',
|
||||
imports: [],
|
||||
templateUrl: './media-videos-list.component.html',
|
||||
styleUrl: './media-videos-list.component.css'
|
||||
})
|
||||
export class MediaVideosListComponent {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user