mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-11-22 06:13:57 +00:00
BETTERZON-33: Added routing
This commit is contained in:
parent
b5c9da6055
commit
e91a0085f6
24
Frontend/src/app/app-routing.module.ts
Normal file
24
Frontend/src/app/app-routing.module.ts
Normal file
|
@ -0,0 +1,24 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {RouterModule, Routes} from '@angular/router';
|
||||
import {HelloWorldComponent} from './hello-world/hello-world.component';
|
||||
import {AppComponent} from './app.component';
|
||||
import {ProductListComponent} from './product-list/product-list.component';
|
||||
|
||||
const routes: Routes = [
|
||||
{path: '', component: AppComponent},
|
||||
{path: 'helloworld', component: HelloWorldComponent},
|
||||
{path: 'pdp', component: ProductListComponent}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
declarations: [],
|
||||
imports: [
|
||||
RouterModule.forRoot(routes)
|
||||
],
|
||||
exports: [
|
||||
RouterModule
|
||||
]
|
||||
})
|
||||
export class AppRoutingModule {
|
||||
}
|
|
@ -1,2 +1 @@
|
|||
<app-hello-world></app-hello-world>
|
||||
<app-product-list-component></app-product-list-component>
|
||||
<router-outlet></router-outlet>
|
||||
|
|
|
@ -3,16 +3,18 @@ import { NgModule } from '@angular/core';
|
|||
|
||||
import { AppComponent } from './app.component';
|
||||
import { HelloWorldComponent } from './hello-world/hello-world.component';
|
||||
import { ProductListComponentComponent } from './product-list-component/product-list-component.component';
|
||||
import { AppRoutingModule } from './app-routing.module';
|
||||
import { ProductListComponent } from './product-list/product-list.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
HelloWorldComponent,
|
||||
ProductListComponentComponent
|
||||
ProductListComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule
|
||||
BrowserModule,
|
||||
AppRoutingModule
|
||||
],
|
||||
providers: [],
|
||||
bootstrap: [AppComponent]
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProductListComponentComponent } from './product-list-component.component';
|
||||
|
||||
describe('ProductListComponentComponent', () => {
|
||||
let component: ProductListComponentComponent;
|
||||
let fixture: ComponentFixture<ProductListComponentComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ProductListComponentComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ProductListComponentComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
|
@ -1,25 +0,0 @@
|
|||
import {Component, OnInit} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-product-list-component',
|
||||
templateUrl: './product-list-component.component.html',
|
||||
styleUrls: ['./product-list-component.component.css']
|
||||
})
|
||||
export class ProductListComponentComponent implements OnInit {
|
||||
testList: string[];
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.testList = ['Herbert', 'Sascha', 'Rolf'];
|
||||
}
|
||||
|
||||
// async function getCrypto(query: object): Promise<object> {
|
||||
// const url = new URL('https://backend.betterzon.xyz');
|
||||
// const headers = {};
|
||||
// const response = await fetch(url.toString(), {headers});
|
||||
// return await response.json();
|
||||
// };
|
||||
|
||||
}
|
25
Frontend/src/app/product-list/product-list.component.spec.ts
Normal file
25
Frontend/src/app/product-list/product-list.component.spec.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProductListComponent } from './product-list.component';
|
||||
|
||||
describe('ProductListComponent', () => {
|
||||
let component: ProductListComponent;
|
||||
let fixture: ComponentFixture<ProductListComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ProductListComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ProductListComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
18
Frontend/src/app/product-list/product-list.component.ts
Normal file
18
Frontend/src/app/product-list/product-list.component.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'app-product-list',
|
||||
templateUrl: './product-list.component.html',
|
||||
styleUrls: ['./product-list.component.css']
|
||||
})
|
||||
export class ProductListComponent implements OnInit {
|
||||
testList: string[];
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.testList = ['Herbert', 'Sascha', 'Rolf'];
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user