mirror of
https://github.com/chsakell/aspnet-core-signalr-angular.git
synced 2025-12-22 09:17:47 +00:00
added chat table - initial
This commit is contained in:
@@ -9,6 +9,7 @@ import { DataService } from './shared/services/data.service';
|
||||
import { HomeComponent } from './home/home.component';
|
||||
import { HighlightDirective } from './shared/directives/highlight.directive';
|
||||
import { MatchComponent } from './shared/components/match.component';
|
||||
import { ChatComponent } from './shared/components/chat.component';
|
||||
import { routing } from './app.routes';
|
||||
|
||||
@NgModule({
|
||||
@@ -20,6 +21,7 @@ import { routing } from './app.routes';
|
||||
],
|
||||
declarations: [
|
||||
AppComponent,
|
||||
ChatComponent,
|
||||
HomeComponent,
|
||||
HighlightDirective,
|
||||
MatchComponent
|
||||
|
||||
@@ -2,4 +2,7 @@
|
||||
<div class="col-md-4" *ngFor="let match of matches">
|
||||
<match [match]="match"></match>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<chat [matches]="matches"></chat>
|
||||
</div>
|
||||
</div>
|
||||
38
app/shared/components/chat.component.html
Normal file
38
app/shared/components/chat.component.html
Normal file
@@ -0,0 +1,38 @@
|
||||
<table class="table table-bordered box">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Match</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let match of matches">
|
||||
<td><span class="teamName">{{match.Id}}</span></td>
|
||||
<td><span class="teamScore"> {{match.Host}} vs {{match.Guest}} </span></td>
|
||||
</tr>
|
||||
<!--<tr>
|
||||
<td colspan="2">
|
||||
<div class="feed-table">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Update</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let feed of match.Feeds" feedHighlight>
|
||||
<td>
|
||||
<span class="feed-time">{{feed.CreatedAt | date:'shortTime' }}</span>
|
||||
</td>
|
||||
<td class="filterable-cell">
|
||||
<span class="feed-update"> {{feed.Description}} </span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>-->
|
||||
</tbody>
|
||||
</table>
|
||||
16
app/shared/components/chat.component.ts
Normal file
16
app/shared/components/chat.component.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
|
||||
import { Match } from '../interfaces';
|
||||
|
||||
@Component({
|
||||
selector: 'chat',
|
||||
templateUrl: 'app/shared/components/chat.component.html'
|
||||
})
|
||||
export class ChatComponent implements OnInit {
|
||||
|
||||
@Input() matches: Match[];
|
||||
|
||||
constructor() { }
|
||||
|
||||
ngOnInit() { }
|
||||
}
|
||||
Reference in New Issue
Block a user