Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions AngularApp/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ const routes: Routes = [
import('./features/profile/profile.module').then((m) => m.ProfileModule),
canActivate: [AuthGuard],
},
{
path: 'table',
loadChildren: () =>
import('./features/table/table.module').then((m) => m.TableModule),
},
//{
// path: 'public',
// loadChildren: () =>
Expand Down
Empty file.
1 change: 1 addition & 0 deletions AngularApp/src/app/features/card/card.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<img src={{image}} alt="Card back" (mouseenter)="mouseEnter()" (mouseleave)="mouseLeave()">
21 changes: 21 additions & 0 deletions AngularApp/src/app/features/card/card.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CardComponent } from './card.component';

describe('CardComponent', () => {
let component: CardComponent;
let fixture: ComponentFixture<CardComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [CardComponent]
});
fixture = TestBed.createComponent(CardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
18 changes: 18 additions & 0 deletions AngularApp/src/app/features/card/card.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-card',
templateUrl: './card.component.html',
styleUrls: ['./card.component.css']
})
export class CardComponent {
image = 'assets/cardback.png';

mouseEnter() {
this.image = 'assets/cardback.png'; //todo: could use different image
}

mouseLeave() {
this.image = 'assets/cardback.png';
}
}
Empty file.
2 changes: 2 additions & 0 deletions AngularApp/src/app/features/playmat/playmat.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<p>playmat works!</p>
<app-zone></app-zone>
21 changes: 21 additions & 0 deletions AngularApp/src/app/features/playmat/playmat.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { PlaymatComponent } from './playmat.component';

describe('PlaymatComponent', () => {
let component: PlaymatComponent;
let fixture: ComponentFixture<PlaymatComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [PlaymatComponent]
});
fixture = TestBed.createComponent(PlaymatComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
10 changes: 10 additions & 0 deletions AngularApp/src/app/features/playmat/playmat.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-playmat',
templateUrl: './playmat.component.html',
styleUrls: ['./playmat.component.css']
})
export class PlaymatComponent {

}
Empty file.
4 changes: 4 additions & 0 deletions AngularApp/src/app/features/table/table.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<div class="content-layout">
<p>table works!</p>
<app-playmat></app-playmat>
</div>
21 changes: 21 additions & 0 deletions AngularApp/src/app/features/table/table.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { TableComponent } from './table.component';

describe('TableComponent', () => {
let component: TableComponent;
let fixture: ComponentFixture<TableComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [TableComponent]
});
fixture = TestBed.createComponent(TableComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
10 changes: 10 additions & 0 deletions AngularApp/src/app/features/table/table.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-table',
templateUrl: './table.component.html',
styleUrls: ['./table.component.css']
})
export class TableComponent {

}
29 changes: 29 additions & 0 deletions AngularApp/src/app/features/table/table.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TableComponent } from './table.component';
import { PlaymatComponent } from '../playmat/playmat.component';
import { ZoneComponent } from '../zone/zone.component';
import { RouterModule } from '@angular/router';
import { MatTableModule } from '@angular/material/table';
import { CardComponent } from '../card/card.component';


@NgModule({
declarations: [
TableComponent,
PlaymatComponent,
ZoneComponent,
CardComponent
],
imports: [
CommonModule,
RouterModule.forChild([{ path: '', component: TableComponent }]),
MatTableModule,
],
exports: [
TableComponent,
PlaymatComponent,
ZoneComponent
]
})
export class TableModule { }
25 changes: 25 additions & 0 deletions AngularApp/src/app/features/zone/zone.component.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.demo-table {
width: 100%;
}

.mat-column-demo-position {
width: 32px;
border-right: 1px solid currentColor;
padding-right: 24px;
text-align: center;
}

.mat-column-demo-name {
padding-left: 16px;
font-size: 20px;
}

.mat-column-demo-weight {
font-style: italic;
}

.mat-column-demo-symbol {
width: 32px;
text-align: center;
font-weight: bold;
}
21 changes: 21 additions & 0 deletions AngularApp/src/app/features/zone/zone.component.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8 demo-table">
<ng-container matColumnDef="demo-position">
<th mat-header-cell *matHeaderCellDef> No. </th>
<td mat-cell *matCellDef="let element"> {{element.position}} </td>
</ng-container>
<ng-container matColumnDef="demo-name">
<th mat-header-cell *matHeaderCellDef> Name </th>
<td mat-cell *matCellDef="let element"> {{element.name}} </td>
</ng-container>
<ng-container matColumnDef="demo-weight">
<th mat-header-cell *matHeaderCellDef> Weight </th>
<td mat-cell *matCellDef="let element"> {{element.weight}} </td>
</ng-container>
<ng-container matColumnDef="demo-symbol">
<th mat-header-cell *matHeaderCellDef> Symbol </th>
<td mat-cell *matCellDef="let element"> {{element.symbol}} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<app-card></app-card>
21 changes: 21 additions & 0 deletions AngularApp/src/app/features/zone/zone.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ZoneComponent } from './zone.component';

describe('ZoneComponent', () => {
let component: ZoneComponent;
let fixture: ComponentFixture<ZoneComponent>;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [ZoneComponent]
});
fixture = TestBed.createComponent(ZoneComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
34 changes: 34 additions & 0 deletions AngularApp/src/app/features/zone/zone.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import {Component} from '@angular/core';
import {MatTableModule} from '@angular/material/table';

export interface PeriodicElement {
name: string;
position: number;
weight: number;
symbol: string;
}

const ELEMENT_DATA: PeriodicElement[] = [
{position: 1, name: 'Hydrogen', weight: 1.0079, symbol: 'H'},
{position: 2, name: 'Helium', weight: 4.0026, symbol: 'He'},
{position: 3, name: 'Lithium', weight: 6.941, symbol: 'Li'},
{position: 4, name: 'Beryllium', weight: 9.0122, symbol: 'Be'},
{position: 5, name: 'Boron', weight: 10.811, symbol: 'B'},
{position: 6, name: 'Carbon', weight: 12.0107, symbol: 'C'},
{position: 7, name: 'Nitrogen', weight: 14.0067, symbol: 'N'},
{position: 8, name: 'Oxygen', weight: 15.9994, symbol: 'O'},
{position: 9, name: 'Fluorine', weight: 18.9984, symbol: 'F'},
{position: 10, name: 'Neon', weight: 20.1797, symbol: 'Ne'},
];

@Component({
selector: 'app-zone',
templateUrl: './zone.component.html',
styleUrls: ['./zone.component.css'],
//standalone: true,
//imports: [MatTableModule],
})
export class ZoneComponent {
displayedColumns: string[] = ['demo-position', 'demo-name', 'demo-weight', 'demo-symbol'];
dataSource = ELEMENT_DATA;
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
<li class="nav-item" [routerLinkActive]="['link-active']">
<a class="nav-link text-dark" [routerLink]="['/profile']">Profile</a>
</li>
<li class="nav-item" [routerLinkActive]="['link-active']">
<a class="nav-link text-dark" [routerLink]="['/table']">Table</a>
</li>
</ul>
</div>
<app-nav-bar-buttons></app-nav-bar-buttons>
Expand Down
Binary file added AngularApp/src/assets/cardback.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.